Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom report restriction

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
How do I get a customized report to prompt the user for information such as a document number?

The report is from a 3rd party product (Order Number) that has no historical report. I copied the original report and replaced with historical tables and it works fine, but can't figure out how to get the user to enter an order number.

We do not have VBA modifier and I do not use Crystal. I do use Access to create reports outside of GP but I want to get away from Access and use mainly VB but still learning!

Thanks!
Barb E.
 
You could create the report in crystal reports and set up a parameter field. This would prompt the user to enter in whatever variable you choose. I know I've created a report that made the user enter in the start and end date, and from that the report calculated out all of the MO's in that range.

Brad [spidey]
 
If I wanted to do this I would do it in Access as that works much better for me than Crystal.

BUT I already have the report created in Great Plains and was hoping there was a way to do this without using a macro that opens report writer for the user.


Thanks!
Barb E.
 
There is.... but it uses an unsupported and undocumented technique in VBA.

Using the Continuum API from VBA you can execute Dexterity sanscript code. You can pass the appropriate run report with name in dictionary command to run the custom report and add your restrictions etc to it.

I have an example of this that I can send you, just email me.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
I don't have VBA modifier and what is a continuum api?

It's okay, I used a macro and it works for our purposes.

Thanks!
Barb E.
 
David,

I'm interested in learning more about how to do this.

Barbola,
How did you use a macro?
 
I recorded a macro from the time the user opens Reports>Customized and it selects the report I created, and prints it to screen. I hardcoded a condition so it only prints one document (one page). The macro then opens the report in report writer and pauses so the user can insert the document number as a "Constant" into a condition in the report, and then it prints the report output to screen, and pauses again, so the user can print the report.

With each pause, the user has to click Macro > Continue and it will take them back to Great Plains. The whole macro runs in under 5 seconds.


Thanks!
Barb E.
 
Guys

Continuum is the COM interface to Great Plains. It allows other applications and development tools to communicate with Great Plains. This is what the Integration Manager standard adaptors use to drive the user interface of Great Plains.

To use this code you must have VBA or at least the customisation site license registered.

Here is an example of the code (including getting the Named Printer for Custom Reports).

'Dim CompilerApp As New Dynamics.Application
Dim CompilerApp As Object
Dim CompilerMessage As String
Dim CompilerError As Integer
Dim Commands As String

' Create link without having reference marked
Set CompilerApp = CreateObject("Dynamics.Application")

Commands = ""

' Get Named Printers settings
Commands = Commands & "local 'Printer Settings' NamedPrinter; " & vbCrLf
Commands = Commands & "NamedPrinter = ST_Set_To_Default_Printer(8, ST_SY_CUSTOM); " & vbCrLf

' Run the report with optional restriction, index and legends
Commands = Commands & "run report with name ""Custom Report Name Here"" " & vbCrLf
'Commands = Commands & " with restriction 'Field Name' of table Table_Name > 0 " & vbCrLf
'Commands = Commands & " by number 1" & vbCrLf
'Commands = Commands & " legends ""Test Legend"" " & vbCrLf

' Swap comments on line below to send report direct to printer instead of screen
Commands = Commands & " destination true, false " & vbCrLf
'Commands = Commands & " destination false, true " & vbCrLf

Commands = Commands & " printer NamedPrinter " & vbCrLf
Commands = Commands & " in dictionary 0; " & vbCrLf
'MsgBox Commands

' Execute SanScript
CompilerError = CompilerApp.ExecuteSanscript(Commands, CompilerMessage)
If CompilerError <> 0 Then
MsgBox CompilerMessage
End If

Please note that this code uses the Continuum library which is not supported for use with VBA by MBS Support.

I can actually send you a package of this if you want it. Please email me. My alias is dmusgrav at microsoft.com.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
We have the customized site license purchased for something we ended up never using, but kept it. We don't have integration manager or VBA modifier.

I know how to use VBA with Excel and Access, but how do I use the code above? Where would I put it? What do I do with it? I am learning VB as well.



Thanks!
Barb E.
 
The Customisation Site License will just allow you to use packages created for you on a system licensed for the full Modifier with VBA.

You would really need someone to write the code for you and then send you the package... or register the full Modifier.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top