[1] All Data Band show same data [2] StiWebViewer in C# page with MasterPage problem
Posted: Tue Apr 26, 2011 11:42 pm
Hi, I now have 2 problems, could anybody give me help:
Q.1:
I am writing a report using C# .Net, showing up to 4 years' sales record by using 4 SqlDataSource and 4 Data Band (I now have data for 2011 and 2010 only)
My problem is that when only one SqlDataSource has records, all the Data Banks will shows the "only result" as following, but I am sure that the selection for the 4 sqldatasource are correct.
==============================================================
[2011] <--Textbox Input
1 Year Before
|Jan| Feb| Mar| Apr| May | Jun | Jul.....
2010 |0 | 0 |0 |0 |0 | 550 | 0 | 0 .....
Selected Year
|Jan | Feb| Mar | Apr| May | Jun | Jul.....
2011 | 619 |0 | 3575 |0 |0 |0 | 0 .....
==============================================================
[2013] <--Textbox Input
3 Year Before
|Jan | Feb| Mar| Apr| May| Jun | Jul.....
2010 | 0 | 0 | 0 | 0 | 0 | 550 | 0 | 0 .....
2 Year Before
|Jan | Feb | Mar| Apr | May | Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 | 0 | 0 .....
==============================================================
[2014] <--Textbox Input (Strange Case)
3 Year Before
|Jan | Feb | Mar | Apr | May | Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 | 0 | 0 .....
2 Year Before
|Jan| Feb | Mar | Apr| May | Jun | Jul.....
2011 |619 | 0 |3575 |0 | 0 | 0 | 0 .....
1 Year Before
|Jan| Feb | Mar | Apr | May| Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 |0 |0 .....
Selected Year
|Jan | Feb | Mar| Apr| May | Jun | Jul.....
2011 | 619 |0 | 3575 |0 |0 | 0 |0 .....
==============================================================
Q.2
When I put the report in an aspx with MasterPage, my StiWebViewer become empty until I use the code:
StiReport report = StiWebReport1.GetReport();
StiWebReport1.RegData(report, "SqlDataSource4", SqlDataSource4);
StiWebReport1.RegData(report, "SqlDataSource3", SqlDataSource3);
StiWebReport1.RegData(report, "SqlDataSource2", SqlDataSource2);
StiWebReport1.RegData(report, "SqlDataSource1", SqlDataSource1);
StiWebViewer1.Report = report;
Every time I update my selection of my SqlDataSources, I call the above code to update the result in StiWebViewer (Q.1 problem still occurs), it works, BUT:
Functions such as "Print to PDF", "Save to Excel" etc. can all only give me the 1st report loaded into the StiWebViewer
This problem only takes place when I use MasterPage, can this be solved?
Q.1:
I am writing a report using C# .Net, showing up to 4 years' sales record by using 4 SqlDataSource and 4 Data Band (I now have data for 2011 and 2010 only)
My problem is that when only one SqlDataSource has records, all the Data Banks will shows the "only result" as following, but I am sure that the selection for the 4 sqldatasource are correct.
==============================================================
[2011] <--Textbox Input
1 Year Before
|Jan| Feb| Mar| Apr| May | Jun | Jul.....
2010 |0 | 0 |0 |0 |0 | 550 | 0 | 0 .....
Selected Year
|Jan | Feb| Mar | Apr| May | Jun | Jul.....
2011 | 619 |0 | 3575 |0 |0 |0 | 0 .....
==============================================================
[2013] <--Textbox Input
3 Year Before
|Jan | Feb| Mar| Apr| May| Jun | Jul.....
2010 | 0 | 0 | 0 | 0 | 0 | 550 | 0 | 0 .....
2 Year Before
|Jan | Feb | Mar| Apr | May | Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 | 0 | 0 .....
==============================================================
[2014] <--Textbox Input (Strange Case)
3 Year Before
|Jan | Feb | Mar | Apr | May | Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 | 0 | 0 .....
2 Year Before
|Jan| Feb | Mar | Apr| May | Jun | Jul.....
2011 |619 | 0 |3575 |0 | 0 | 0 | 0 .....
1 Year Before
|Jan| Feb | Mar | Apr | May| Jun | Jul.....
2011 |619 | 0 | 3575 |0 | 0 |0 |0 .....
Selected Year
|Jan | Feb | Mar| Apr| May | Jun | Jul.....
2011 | 619 |0 | 3575 |0 |0 | 0 |0 .....
==============================================================
Q.2
When I put the report in an aspx with MasterPage, my StiWebViewer become empty until I use the code:
StiReport report = StiWebReport1.GetReport();
StiWebReport1.RegData(report, "SqlDataSource4", SqlDataSource4);
StiWebReport1.RegData(report, "SqlDataSource3", SqlDataSource3);
StiWebReport1.RegData(report, "SqlDataSource2", SqlDataSource2);
StiWebReport1.RegData(report, "SqlDataSource1", SqlDataSource1);
StiWebViewer1.Report = report;
Every time I update my selection of my SqlDataSources, I call the above code to update the result in StiWebViewer (Q.1 problem still occurs), it works, BUT:
Functions such as "Print to PDF", "Save to Excel" etc. can all only give me the 1st report loaded into the StiWebViewer
This problem only takes place when I use MasterPage, can this be solved?