| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
crystal reports (the coder way) ?
Hi
I have a .NET application that needs to obtain the details of the parameters for a crystal report. I have written some code, that opens a report into the crystal viewer and the gets the parameter info and displays it in a msgbox. However, the viewer prompts for the parameters, before i get a chance to get the information and display it. My question is, does anyone know of a way that i can get the parameter information from a report, without the user being prompted for the parameters ? Thanks in anticipation
__________________
Oni |
|
#2
|
|||
|
|||
|
[Moved thread]
__________________
Ciao, Andreas "Software is like sex, it's better when it's free." - Linus Torvalds Article(s): Allocators (STL) Function Objects (STL) |
|
#3
|
|||
|
|||
|
YOu need to populate the parameters to the report before viewing it the viewer or printing it to the printer.
here is a sample from VB on how to populate parameters and formulas. Code:
Dim crFormula As CRAXDRT.FormulaFieldDefinition
Dim crParam As CRAXDRT.ParameterFieldDefinition
crReport.DiscardSavedData
For Each crParam In crReport.ParameterFields
Select Case crParam.Name
Case "{?SortType}"
crParam.AddCurrentValue m_strSortType
End Select
Next crParam
For Each crFormula In crReport.FormulaFields
Select Case crFormula.Name
Case "{@StartDate}"
crFormula.Text = "DATE( 2001, 01, 01)"
Case "{@EndDate}"
crFormula.Text = "DATE( 2002, 03, 30)"
crFormula.Text = """All Offices"""
Case "{@DetailOrSummaryFlag}"
crFormula.Text = """" & m_strSummaryDetailFlag & """"
Case "{@Seperate}"
crFormula.Text = """FALSE"""
Case "{@SetShowWarning}"
crFormula.Text = """FALSE"""
Case Else
'do nothing
End Select
Next crFormula
|
|
#4
|
|||
|
|||
|
Quote:
Dim APP As New CRAXDRT.Application Dim REPORT As CRAXDRT.Report REPORT = APP.OpenReport("C:\SHIPMENT_SCHEDULE\REPORTS\XL.rpt") REPORT.EnableParameterPrompting = False (this is the one you should include...disabling the parameter prompting) |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|