Click here to Skip to main content
15,921,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have make one report which have 7 sub reports.
this report will open very slowly, while other reports open fast.
I have find problem in subreport setdatasource fillup.

sReport.Subreports["IncommingTruck"].SetDataSource(ds.Tables[0])


Except this line all code execute fast and report open fast.
but i can't understand how to solve it ?
please help me..

I have use odbc coonection in all report.
other report have more data, while this report have few records compare to other
report.

What I have tried:

string SpName = "GetTruckIncomingForBossReport";
SqlCommand cm = new SqlCommand(SpName.ToString(), Program.Conn);
cm.CommandType = CommandType.StoredProcedure;
cm.Parameters.Clear();
cm.Parameters.Add("@CurrentDate", SqlDbType.DateTime).Value = DateTime.Parse(mebFromDate.Text);
cm.Parameters.Add("@RegionAuto", SqlDbType.VarChar, 8000).Value = RegionAuto;
if (Program.Conn.State == ConnectionState.Open)
{ Program.Conn.Close(); }
Program.Conn.Open();
SqlDataAdapter da = new SqlDataAdapter(cm);
ds = new DataSet();
da.Fill(ds);
sReport.Subreports["IncommingTruck"].SetDataSource(ds.Tables[0]);
Posted
Updated 19-Mar-17 23:36pm
v2
Comments
CHill60 20-Mar-17 5:34am    
How many rows are being returned (in comparison to the other reports). We can't see the stored procedure.
Member 9720862 20-Mar-17 5:36am    
other report have more data, while this report have few records compare to other
report.
CHill60 20-Mar-17 7:08am    
You need to use the Reply link so that people leaving Comments are notified when you reply.
Perhaps you need an index on a table. We can't see your stored procedure.
Do you have more formatting on that sub-report. We can't see your report.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900