is this possible

Stimulsoft Reports.WEB discussion
Post Reply
shakeeb ahmed
Posts: 21
Joined: Tue Aug 28, 2012 12:28 pm

is this possible

Post by shakeeb ahmed »

:ugeek: well here is something i have been looking for well i have designed a report in designer and have named all the fields as such {sp_CustomForms_UCAF.ProviderName} where sp_CustomForms_UCAF is supposed to be the name of the data source in the report and "ProviderName" as the column name now what i want to do is to pass the values for these columns from the source of my project in the shape of a sql dataset hence making this much more usable for us. i am attaching the report here please guide me how it is possible . my manager has asked me to do something like it happened in Crystal reports design in the designer and pass data from the source please help in this issue.
Attachments
UCAF.mrt
report
(1.15 MiB) Downloaded 216 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: is this possible

Post by Alex K. »

Hello,

You can use the following code.
New connection string:

Code: Select all

report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Add DataSources:

Code: Select all

StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
report.Dictionary.DataSources.Add(DS1);
Add Columns:

Code: Select all

foreach (DataColumn col in dataTableDS1.Columns)
{
     DS1.Columns.Add(col.ColumnName, col.DataType);
}
Thank you.
shakeeb ahmed
Posts: 21
Joined: Tue Aug 28, 2012 12:28 pm

Re: is this possible

Post by shakeeb ahmed »

Can i Add a Sql Dataset in StiSqlSource or can i execute a stored procedure and pass parameters instead of using a select command ??
shakeeb ahmed
Posts: 21
Joined: Tue Aug 28, 2012 12:28 pm

Re: is this possible

Post by shakeeb ahmed »

this all is done but how can i bind data with it via a dataset when report has to be viewed
shakeeb ahmed
Posts: 21
Joined: Tue Aug 28, 2012 12:28 pm

Re: is this possible

Post by shakeeb ahmed »

remember that in my report the fields are done as "{sp_CustomForms_UCAF.AccountName}" so the name of the datasource should be -sp_CustomForms_UCAF and i am till now doing the following it is opening the report in reportviewer without loading loading any data please help

sp_CustomForms is the dataset which contains the feilds and data

Dim Con As String = "Data Source=.;Initial Catalog=Standard_Hospital; Asynchronous Processing=true ;User ID=sa"

Rep.Dictionary.Databases.Clear()
Rep.Dictionary.Databases.Add(New Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Con))

Dim sp_CustomForms_UCAF = New StiSqlSource("Connection", "sp_CustomForms_UCAF", "sp_CustomForms_UCAF", "execute sp_CustomForms_UCAF", True, False)
Rep.Dictionary.DataSources.Add(sp_CustomForms_UCAF)

For Each col In sp_CustomForms.Columns

sp_CustomForms_UCAF.Columns.Add(col.ColumnName, col.DataType)

Next

Rep.RegData("Connection", ds)
Rep.Compile()

Me.StiWebViewer1.Report = Rep
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: is this possible

Post by Alex K. »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
Post Reply