Passing Parameter to Crystal Report
Hi Experts,
I have created and designed a Report in Crystal Report 2005. I am displaying the report in SAP B1 using Win Form . Here I want to pass 2 parameters to Report ---@FromDate and @ToDate . I have coded to pass these two parameters this way :
Dim RptDoc As New ReportDocument
Dim ParamValue As String = String.Empty
Dim crtableLogoninfos As New CrystalDecisions.Shared.TableLogOnInfos
Dim crtableLogoninfo As New CrystalDecisions.Shared.TableLogOnInfo
Dim crConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim CrTables As CrystalDecisions.CrystalReports.Engine.Tables
Dim CrTable As CrystalDecisions.CrystalReports.Engine.Table
Try
RptDoc.Load(Application.StartupPath() & "\" & ReportName & ".rpt")
RptDoc.SetParameterValue("@FromDate", "01/01/2008")
RptDoc.SetParameterValue("@ToDate", "12/31/2008")
Dim oForm_ReportViewer As Frm_ReportViewer = New Frm_ReportViewer()
oForm_ReportViewer.CRViewer.ReportSource = RptDoc
With crConnectionInfo
.ServerName = oCompany.Server '"(local)"
.DatabaseName = oCompany.CompanyDB '"SBODemoIn"
.UserID = oCompany.DbUserName
.Password = "manager@123" 'oCompany.DbPassword
End With
CrTables = RptDoc.Database.Tables
'Loop through each table in the report and apply the
'LogonInfo information
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
oForm_ReportViewer.Text = frmTitle
oForm_ReportViewer.WindowState = FormWindowState.Maximized
oForm_ReportViewer.ShowDialog()
Catch Ex As Exception
MessageBox.Show(Ex.ToString)
End Try
But When I view the report in B1 , it throws an Exception "Report or Procedure expects parameter @FromDate which is not supplied. "
Please help me where I am making mistake , what could be the cause of this exception..
Thanks and Regards,
Pooja Singh.
Hi Pooja Singh,
You have only set Dim ParamValue As String = String.Empty. Where are two parameter @FromDate and @ToDate?
SetParameterValue will only work if you have defined the parameters already and the parameters have the right format.
You may check this thread:
Re: Crystal report open instead of PLD with same form reference.
Thanks,
Gordon
Similar Messages
-
Problem passing parameter to crystal report subreport from *.aspx page
Background:
I am developing a .NET web application using Visual Studio 2005. The code behind is in VB.net. One of my asp.net pages calls a report, which is invoked when the user clicks a Print button. I have developed this report using the Crystal Reports software that is bundled with Visual Studio 2005. I am passing one parameter from the asp.net page (utilizing the VB.net code-behind on the Print button) to the Crystal report. The report consists of a main report and 5 subreports. Both the main report and the subreports use the same parameter. Both the main report and the subreports are bound to stored procedures, each of which require a parameter.
Problem:
For some reason, the parameter is not being passed from the asp.net page to the report. I am receiving the following error: "CrystalDecisions.CrystalReports.Engine.ParameterField.CurrentValueException: Missing Parameter Values." However, when I remove the subreports, the parameter gets passed, and the report is invoked with no problem.
I have read in other forums that there may be an issue with the Crystal Reports software that is causing this problem. I have downloaded and run the suggested hotfix, but the problem remains unresolved. I have tried changing the linking of my main report to the subreport, but that doesn't help either. It is possible that I am doing something wrong with the linking, as this is the first time I have developed a report with Crystal Reports. I need a workaround or definitive solution. Below is the aspx code used to call the report:
Imports System
Imports System.Collections.Specialized
Imports System.Collections.ObjectModel
Imports System.Collections
Imports System.Text
Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.SqlClient.SqlDataAdapter
Imports System.Web.Configuration
Imports Crystaldecisions.crystalreports.engine
Imports Crystaldecisions.reportsource
Imports Crystaldecisions.shared
Partial Class OACIS_Award_or_Deny_BudgetSummary_PrintRpt
Inherits System.Web.UI.Page
Dim paramFields As ParameterFieldDefinitions
Dim paramField As ParameterFieldDefinition
Dim paramValue As ParameterValues
Dim paramDiscreteValue As New ParameterDiscreteValue
Public Shared idCase, nameRpt As String
Private PrintRpt As ReportDocument
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
idCase = Request.QueryString("id")
nameRpt = Request.QueryString("prtName")
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~/")
Dim settings As AppSettingsSection = DirectCast(config.GetSection("appSettings"), AppSettingsSection)
Dim file As String = settings.File
Dim dSource, iCatalog, userIs, passUser, appString As String
dSource = Nothing
iCatalog = Nothing
userIs = Nothing
passUser = Nothing
appString = config.ConnectionStrings.ConnectionStrings("OacisConn").ToString()
Dim AppArray() As String = Split(appString, ";")
Dim arrayLgth As Integer = AppArray.Length
Dim i As Integer
For i = 0 To arrayLgth - 1
Dim pairIs() As String = Split(AppArray(i), "=")
Dim firstItem As String = pairIs(0)
Dim secondItem As String = pairIs(1)
If firstItem = "Data Source" Then : dSource = secondItem : End If
If firstItem = "Initial Catalog" Then : iCatalog = secondItem : End If
If firstItem = "UID" Then : userIs = secondItem : End If
If firstItem = "PWD" Then : passUser = secondItem : End If
Next
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim crconnectioninfo As ConnectionInfo
Dim crDatabase As Database
Dim crtables As Tables
Dim crtable As Table
Dim crtablelogoninfo As TableLogOnInfo
Dim Fname As String
Dim Prtname As String
Dim FPath As String
Dim crSection As Section
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
FPath = Server.MapPath("") + "\"
Dim rptIs As String = nameRpt
crReportDocument = New ReportDocument
Prtname = FPath
Prtname = Prtname + rptIs
crReportDocument.Load(Prtname)
Fname = "C:\WINDOWS\TEMP\" & Session.SessionID.ToString & ".pdf"
crconnectioninfo = New ConnectionInfo
crconnectioninfo.ServerName = dSource
crconnectioninfo.DatabaseName = iCatalog
crconnectioninfo.UserID = userIs
crconnectioninfo.Password = passUser
crDatabase = crReportDocument.Database
crtables = crDatabase.Tables
For Each crtable In crtables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
Response.Write(ex)
Exit Sub
End Try
Next crtable
For Each crSection In crReportDocument.ReportDefinition.Sections
For Each crReportObject In crSection.ReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
crSubreportObject = CType(crReportObject, SubreportObject)
subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
For Each crtable In subRepDoc.Database.Tables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
End Try
Next
End If
Next
Next
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
Dim parIDCase As ParameterValues = New ParameterValues
Dim disIDCase As ParameterDiscreteValue = New ParameterDiscreteValue
disIDCase.Value = idCase
parIDCase.Add(disIDCase)
crReportDocument.DataDefinition.ParameterFields("@ID_CASE_NMBR").ApplyCurrentValues(parIDCase)
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Catch ex As Exception
lblMessage.Visible = True
lblMessage.Text = "Error Load
" & Convert.ToString(ex)
End Try
End Sub
End Class
Your help is greatly appreciated!Thanks for your help!
I've now gotten past the "missing parameter values" error, and the report renders fine in the report viewer. However, I've encounted another problem. The data in my main report displays correctly, but the data in my subreport does not display. Of course, when I view the report in the designer, both the main report and subreport display correctly. What am I doing wrong? Below is my vb.net code:
Try
idCase = Request.QueryString("id")
nameRpt = Request.QueryString("prtName")
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration("~/")
Dim settings As AppSettingsSection = DirectCast(config.GetSection("appSettings"), AppSettingsSection)
Dim file As String = settings.File
Dim dSource, iCatalog, userIs, passUser, appString As String
dSource = Nothing
iCatalog = Nothing
userIs = Nothing
passUser = Nothing
appString = config.ConnectionStrings.ConnectionStrings("OacisConn").ToString()
Dim AppArray() As String = Split(appString, ";")
Dim arrayLgth As Integer = AppArray.Length
Dim i As Integer
For i = 0 To arrayLgth - 1
Dim pairIs() As String = Split(AppArray(i), "=")
Dim firstItem As String = pairIs(0)
Dim secondItem As String = pairIs(1)
If firstItem = "Data Source" Then : dSource = secondItem : End If
If firstItem = "Initial Catalog" Then : iCatalog = secondItem : End If
If firstItem = "UID" Then : userIs = secondItem : End If
If firstItem = "PWD" Then : passUser = secondItem : End If
Next
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim crconnectioninfo As ConnectionInfo
Dim crDatabase As Database
Dim crtables As Tables
Dim crtable As Table
Dim crtablelogoninfo As TableLogOnInfo
Dim Fname As String
Dim Prtname As String
Dim FPath As String
Dim crSection As Section
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim subRepDoc As New ReportDocument
FPath = Server.MapPath("") + "\"
Dim rptIs As String = nameRpt
crReportDocument = New ReportDocument
Prtname = FPath
Prtname = Prtname + rptIs
crReportDocument.Load(Prtname)
Fname = "C:\WINDOWS\TEMP\" & Session.SessionID.ToString & ".pdf"
crconnectioninfo = New ConnectionInfo
crconnectioninfo.ServerName = dSource
crconnectioninfo.DatabaseName = iCatalog
crconnectioninfo.UserID = userIs
crconnectioninfo.Password = passUser
crDatabase = crReportDocument.Database
crtables = crDatabase.Tables
For Each crtable In crtables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
Response.Write(ex)
Exit Sub
End Try
Next crtable
For Each crSection In crReportDocument.ReportDefinition.Sections
For Each crReportObject In crSection.ReportObjects
If crReportObject.Kind = ReportObjectKind.SubreportObject Then
crSubreportObject = CType(crReportObject, SubreportObject)
subRepDoc = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName)
For Each crtable In subRepDoc.Database.Tables
Try
crtablelogoninfo = crtable.LogOnInfo
crtablelogoninfo.ConnectionInfo = crconnectioninfo
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.SetDataSource(Prtname)
crtablelogoninfo.ConnectionInfo.DatabaseName = iCatalog
crtablelogoninfo.ConnectionInfo.UserID = userIs
crtablelogoninfo.ConnectionInfo.Password = passUser
crtable.ApplyLogOnInfo(crtablelogoninfo)
crtable.Location = iCatalog + ".dbo." + crtable.Name
Catch ex As Exception
End Try
Next
End If
Next
Next
crDiskFileDestinationOptions = New DiskFileDestinationOptions()
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
crReportDocument.SetParameterValue("@ID_CASE_NMBR", idCase)
crReportDocument.SetParameterValue("@ID_CASE_NMBR", idCase, "MemberName")
crReportDocument.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
Catch ex As Exception
lblMessage.Visible = True
lblMessage.Text = "Error Load<br>" & Convert.ToString(ex)
End Try
Edited by: LaShandra Knox on Sep 17, 2008 7:59 PM -
[Error] }Passing Parameter to Crystal Reports
When I pass the parameter to .rpt from asp.net(vb).
(e.g.: http://domain/report.aspx?p=123)
That's fine for my local development pc(w2kpro).
But, when I put the project to server(w2kserver),
(e.g.: http://domain:8080/report.aspx?p=123)
then, the web page always prompt the inquiry for the parameter.(just the attached file.)
Please help!
SMPlease re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly
-
Passing Value from Crystal Report (special function) to Business View parameter
Friends,
Í have a scenario where i need to pass value from Crystal Report to a Business view's parameter.
Eg : CurrentCEUsername (func in crystal report)-- gives login user which i should pass to parameter in a Business view (used in the same report).
Will be able to explain more if required.
Thanks in Advance,
BharathI guess you got the picture wrong. User_id is not a report_level parameter .
In Data Foundation, below query is used..
select Acc_Number, Account_Group,User_id from Accounts where user_id={?User_id}
where in {?User_id} is the BV parameter...
The Filter was a solution. But it takes long time to Query all the data from DB and then filter at BV level.
How do i pass the CurrentCEUsername to {?User_id}
Value should ve CurrentCEusername always. so that query will be
select Acc_Number, Account_Group,User_id from Accounts where user_id=CurrentCEusername
It will restrict the data pulled from DB to BV .. right? -
Help Needed in passing parameter to cryst report
Hello everyone, I am trying to create a report for a single record and as such am trying to pass parameters to a crystal report but I am not sure exactly how to do this. This is my own method that I am employeeing. I do not want to create a data table and put all the info I need in there and then base a report off of it. I do not want to deal with loops and arrays right now. I just want to pass for example parameter JuvenileID = 1 to my crystal report, then create a command under the database expert and set the parameter for my command to the parameter I passed my crystal report. How would I go about in doing this? I am using VS 2010 C#. This is a windows application. I have a dataentry form that is already populated with the info needed for the report. I just need to pass all the controls.text values to the report and populate it that way.
I'm not sure if I fully understand the issue, but since you have all the data you need in a data entry form that is already populated, why don't you simple create an ADO .NET Dataset and pass that to the report? Much easier to implement, faster execution with the small amount of data you have and less code.
Dataset sample app is here:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
More info on datasets is here:
[1511438 - How to use datasets to pass data to crystal reports|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533313331333433333338%7D.do].
- Ludek -
Passing SQL to Crystal Reports Server using JAVA
Hi all,
We are in the process of redoing our Java app and we would like to create SQL query and pass this to Crystal Reports Server to have it generate a report.
I've looked all over but still could not find any info on it. Does anyone know how this is done or know where I can find some information on this?
I've looked at some of the examples from BO but did not find anything relating to what I need to have.
Thanks in advance.
-S.C.-Hey,
Have a look at https://boc.sdn.sap.com/node/452
There some other great webinars on the left side also.
Hope that helps.
Else if you wanting to run some SQL before loading the report search for something along the lines of:
(But I warn you this is not the correct coding, I have just quickly cut and paste a
few bits from one of my reports but you should get the idea, hopefully,
might have to use your imagination.)
Connection connection = null;
CallableStatement cs;
Class.forName(dbDriverName);
// Create a connection to the database
connection = DriverManager.getConnection(dbConnectionURL, dbUsername, dbPassword);
// Call a procedure with one IN parameter
cs = connection.prepareCall("{ CALL " + str_ProcStatement + "}");
cs.setString(1, str_Param1); -
PASSING PARAMETERS TO CRYSTAL REPORTS THRU FORMS!
Hi! all,
Is there someone who passed parameters to crystal reports from
forms 5.0?
The problem is when I call the report executable from the form,
its giving a login prompt again which is not desirable as @ this
stage the user has already logged in once. So is there a way to
pass this as a parameter to crystal or may be any better way???
Thanx for the solution,
Hima
nullFirst make sure you are on SP 3:
https://smpdl.sap-ag.de/~sapidp/012002523100007123572010E/cr2008_sp3.exe
SP 3 msi
https://smpdl.sap-ag.de/~sapidp/012002523100007123592010E/cr2008sp3_redist.zip
SP 3 msm
https://smpdl.sap-ag.de/~sapidp/012002523100007123582010E/cr2008sp3_mm.zip
Have a look at [Crystal Reports for Visual Studio 2005 Walkthroughs|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2081b4d9-6864-2b10-f49d-918baefc7a23]
(The above does apply to your version of CR also)
Have a look at the samples:
https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
And look at the Developer Help file:
http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_dg_12_en.chm
And don't forget to use the search box at the top right corner of this web page. It will bring up KBases, blogs, wikis, articles and more. Searching these forums is also a good idea.
- Ludek -
How to use Dynamic cascading parameter in crystal Report XI ?
Hi,
I want to use Dynamic cascading parameter in crystal Report XI which is to be viewed through the infoview without using the Business View.Is it possible?
I could implemented Dynamic cascading parameter using the CR XI developer without using Business View, but cannot view the report when uploaded it to BOXI, through infoview.
Please suggest..
Thanks in advance..
RajneeshIn the crystal reports field explorer>right click on parameter field>create new-->name the parameter field and select the type as dynamic. Now in the value field click the row and add the database field also add another field below that by clicking on the next row so..on. The order should be like this parent field first and then child field next...... Also click on the last column to add parmater for each level.
Regards,
Raghavendra -
Pass parameter to ssrs report in performance point webpart from textbox text
How to pass parameter to ssrs report in performance point webpart from textbox text
Please help me to solve this ...
Bikky KumarEdit your SharePoint page and add new text filter web part.
Then pass the text filter value to your performance point report using connections. Your report should include at least one parameter to get the value. More over you can set default value in text filter. -
Optional Prompt for Date type parameter in Crystal Report.
Hi Every One,
I have a date type parameter in crystal report.When I am convert it to optional prompt it is showing following message.
But the Type field is gray out when I was selecting list of values Dynamic.
Please suggest.
Thanks and Regards
DEVHi,
Please check SAP note:
1710595 - CR_Defining "Optional Prompt" as True for SAP Crystal
Reports Does Not Work
Thanks & Regards,
Nagarajan -
Passing single/multiple values to stored proc parameter from crystal report
I tried below solution posted on this forum to pass either a single value or multi-value to a sql server stored procedure parameter (varchar datatype) from crystal report XI R2.
In my crystal report , I am displaying all the available parameter values to the user and the user will select either a single value or multi value.
This worked when I select single value and when I say show sql query in my subreport I see the following:
{CALL "XYZ"."dbo"."storedprocedurename";1('Product 1')}
But this did not worked when I selected multiple values and when I say show sql query in my subreport I see the following:
{CALL "XYZ"."dbo"."storedprocedurename";1('Product 1,Product 2')}
I think it might work if it is as below:*
For multiple values:
{CALL "xyz"."dbo"."storedprocedurename";1('Product 1', 'Product 2')}
Please advise.
Solution Posted on this forum is as follows:
Hi,
As you must be aware of that a crystal report created of a stored procedure will allow only a single value for inserting a multiple value as a parameter in your report and pass those values to your stored procedure please follow the below work around which will be helpful for you.
Symptom
In Crystal Reports, you want to pass a multi-value parameter to a stored procedure. The problem with doing so is that Crystal Reports considers the multi-value parameter to be an array.
How can you pass a multi-value parameter to a stored procedure?
Resolution
Here are the steps to pass a multi-value parameter to a stored procedure:
1. Create a Crystal report, and add a multi-value parameter.
2. Since the multi-value parameter is treated as an array, create a formula that uses the JOIN function. Create a formula as below:
//Formula: @JoinFormula
Join ({?Multi-value parameter array},";")
====================
NOTE:
In the formula above, a semi-colon (";") is the delimiter.
====================
3. Within the main report, create a subreport based on the stored procedure, and include the parameter to be populated with the multi-value list.
4. Link the Join formula in the main report to the stored procedure parameter in the subreport.
Doing so passes a multi-value parameter to the stored procedure.
Regards,
VinayHi Vinay,
First you need to make sure the stored procedure accepts multiple values in the fashion 'a','b','c'.
Then, create this formula in the Main Report:
numbervar i;
stringvar s;
for i:= 1 to ubound({?Parameter}) do
s := s + "'" + {?Parameter}<i> + "'" + ",";
left(s,len(s)-1);
Link this formula to the sub-report's parameter.
Hope this helps!
-Abhilash -
How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur
Hi,
I use the following code to pass the parameters:
Rep.Tables[0].ConnectBuffer := Connection_Str;
Rep.Tables[0].AliasName := 'REP';
Rep.Connect.Propagate := True;
Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
Rep.WindowState := wsMaximized;
Rep.Show;
The 1st parameter 'Lang' which created from crystal report pass well,
but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
However in MS SQL Server the above code work fine with the 2 Parameters.
Any one has solution,Hello,
Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
The Parameter collection has all parameters.
Thank you
Don -
Passing Parameter from Main report to SQL command-based subreport
I am trying to cut down the run time of my reports and have recently figured out how to write SQL commands to limit the data by filtering prior to being pulled into the reports. However, many of my reports rely on multiple sub reports, which can cause a dramatic 'drag' on the report.
I am trying to filter the SQL command used in my sub report by passing the group parameter, which is selected by the user in the main report, to the sub report's SQL command. Without this parameter, the sub report has to sort through a lot more data than it would with this parameter, making the run time extremely slow.
Any suggestions on how I can accomplish this?
Thanks for any help you can provide,
Marlene Allen
Crystal Reports Developer
Crystal Reports Professional;
Product Type: Full;
Product Version 11.5Hi Marlene,
I don't believe you can pass a CR parameter to a Command object.
I suggest replacing all of the Command Objects with a Stored Procedure so all of the data filtering is done server side. DB servers are much more proficient at collecting the data and filtering than CR will ever be. It will also allow you to replace subreports to also speed up your report processing. All depends on your layout of course but something to look at.
Thank you
Don -
Passing Parameters to Crystal Report
Dear all,
I wonder if anybody has tried out the crystal report bundled with workshop
in SP2.
I got some problems when I try to pass a parameter from a jsp in workshop to
crystal report according to part 4 of tutorial in the Crystal Reports for
BEA Weblogic workshop Developer's guide.
This message show in the web browser:
com.crystaldecisions.report.web.viewer.CrystalReportViewer
Some parameters are missing values
However, the report viewer works fine in workshop if I am not passing
parameters.
If anyone has successfully setup a report which involves parameter passing
in workshop, I would appreciate you can share the tricks how to make it
work.
Thanks!
Orion YiuHi Orion,
I have the same issue like the one you sent to bea helpdesk . Please, if you got any positive response on that issue. Need help. Thanks you for you time.
Abdellah -
- I have a Product list box (asp.net) used as multiple selected values for a parameter.
- The Product ID is defined in the Oracle procedure as NUMBER data type.
- In my crystal report, I have a parameter field allow multiple values as p_product_id type as Number. This is the code in my Record Selection Formula for the report:
({?p_product_id}[1] = -1 OR {Procedure_name.product_id} in {p_product_id})
- In C#, this is my code
List<decimal?> productUnit = new List<decimal?>();
int counter = 0;
decimal prod;
for (int i = 0; i < lstProducts.Items.Count; i++)
if (lstProducts.Items[i].Selected)
if (decimal.TryParse(lstProduct.Items[i].Value, out prod))
productUnit.Add((decimal?)prod);
counter++;
if (counter == 0)
productUnit.Add(-1);
ReportingDAO rDataFactory = new ReportingDAO();
retVal = rDataFactory.GetProductReport(productUnit);
public CrystalDecisions.CrystalReports.Engine.ReportDocument GetProductReport(List<decimal?> productUnit)
CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptProductDownload();
ReportLogon rptLog = new ReportLogon();
rptLog.Logon(retVal, "RPT_PRODUCT_DOWNLOAD");
retVal.SetParameterValue("p_product_id", productUnit);
I keep having the "Value does not fall within the expected range" when I debug. My question is, is the data type I used for procedure/Crystal report/ and C# correct ? I always have problem with the data type. Any help would be
appreciated
Thank youHi progGirl,
Thank you for your post, but Microsoft doesn't provide support for CrystalReport now. Please post your question in SAP official site here:
http://forums.sdn.sap.com/forum.jspa?forumID=313
Thank you for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Deploy web application in jbuilder 9 with weblogic 7 problem
when i create a web application and a servlet, and deploy it in jbuilder 9 with weblogic 7.0 ,jbuilder 9 showed me the error,please tell me why, when i choose "redeploy" ,it can be normally work.. E:\bea\jdk131_02\bin\javaw -classpath E:\bea\weblogic
-
Reg:Error message in MIGO Transaction
Hi All, I added the new tab strip in MIGO Screen. now i need to make all the fields as mandatory. so using BADI (MB_MIGO_BADI) i gave the mandatory check ( if the Zfield = ' ', then error message) while clicking the check button before posting the ma
-
How do I get my FaceTime icon back on my iPhone 5 after accidentally deleting it
How do I get my FaceTime icon back on my iPhone 5 after accidentally deleting it
-
i made a apple id on the computer and when i tryed to sing on from my iphone it told me that id was not made
-
I want to report a bug in the program Premiere Pro CC 2014. it first appeared in version CC. blending modes bug Compound Arithmetic Composite each time one and the same Describe a situation in which there is this bug I apply a preset, any of these ef