accessing parameters for a web report

Stimulsoft Reports.NET discussion
Post Reply
LenaB
Posts: 11
Joined: Tue Apr 24, 2007 9:28 am
Location: Montreal canada

accessing parameters for a web report

Post by LenaB »

Hi
I have to know what parameters a report requires and then send those parameters to the report.
I can set up a report with un named parameters but how do I access then in my code.
If I set up an unnamed parameter called "para1" as a date type for a connection called "Connection" for a data source called "QCDocs" in report STIReport1
then in my page load I have the code:

inputType= stiReport1. ?? to get the types of parametes

i input the data

on button click to print report event :

StiReport1.GlobalizationStrings.LocalizeReport(LangCode)
StiReport1. ???? = inpDate.toShortDateString

StiWebViewer1.Report = StiReport1


Thanks for your time

Lena

LenaB
Posts: 11
Joined: Tue Apr 24, 2007 9:28 am
Location: Montreal canada

accessing parameters for a web report

Post by LenaB »

Ok so I figured out from various examples that I
have to

stiReport1.compile()
stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).ParameterValue= xxx
will get the data INTO the report

But where do I find the list of parameters and and their data types?

Lena
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

accessing parameters for a web report

Post by Edward »

You are absolutely correct.

Each parameter has a name. It is doesn't matter is it named or unnamed parameter. You can get the parameter via its index or by its name.

The type of the parameter you can get in the following way:

Code: Select all

stiReport1.CompiledReport.DataSources("QCDocs").Parameters(1).Type
The list of the Parameters of the DataSource QCDocs
is stiReport1.CompiledReport.DataSources("QCDocs").Parameters
so please scan all DataSources and you can get full list of the Parameters in the report.


Thank you.
LenaB
Posts: 11
Joined: Tue Apr 24, 2007 9:28 am
Location: Montreal canada

accessing parameters for a web report

Post by LenaB »

Hi
That works great!
Thank you
Now I realize that every report has to have a unique connection string because of the passwords and permissions
connections strings are in the dictionary and associated with a database. It is an SQL database.

stiReport1.CompiledReport.Dictionary.Databases(0)
is as far as I can get in finding where the connection string is stored

Thanks for your help.

Lena


Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

accessing parameters for a web report

Post by Vital »

You can use following code:

Code: Select all

stiReport1.CompiledReport.Dictionary.Databases.Clear();
stiReport1.CompiledReport.Dictionary.Databases.Add(new StiSqlDatabase("NameOfYourDatabase", ConnectionString);
Thank you.
LenaB
Posts: 11
Joined: Tue Apr 24, 2007 9:28 am
Location: Montreal canada

accessing parameters for a web report

Post by LenaB »

Thank you so much for your prompt reply

Lena
Guest
Posts: 182
Joined: Tue Jun 06, 2006 8:04 am

accessing parameters for a web report

Post by Guest »

If you have any suggestions or questions do not hesitate to write us.

Thank you.
Post Reply