Page 1 of 1
WebReportViewer Hide When Sorting An Column
Posted: Thu Aug 13, 2015 8:38 am
by mghusername
I Create A report from C# Asp.net with 10 Page
when i click on a text control in columnband for Sorting the WebReportViewer Become Empty and don't show any thing.
Re: WebReportViewer Hide When Sorting An Column
Posted: Thu Aug 13, 2015 9:50 am
by HighAley
Hello.
What version of our assemblies do you use?
Could you send us a screen-shot of the Viewer?
Thank you.
Re: WebReportViewer Hide When Sorting An Column
Posted: Thu Aug 13, 2015 12:41 pm
by mghusername
C# Asp.net Code
Stimul Soft 2015 assemblies
StiReport report = new StiReport();
string strpath = HttpContext.Current.Server.MapPath("~\\");
report.Load(strpath + "Report.mrt");
string strSql = @"
select top 10 * from product";
DataTable dt = new DataTable("Per");
SqlConnection con = new SqlConnection();
con.ConnectionString = "Data Source=.;Initial Catalog=CrmReports;Integrated Security=True";
SqlDataAdapter da = new SqlDataAdapter(strSql, con);
da.Fill(dt);
StiPage page = report.Pages[0];
page.Orientation = StiPageOrientation.Portrait;
report.RegData(dt);
report.Dictionary.Synchronize();
StiHeaderBand TitleBand = new StiHeaderBand();
TitleBand.Height = 1;
TitleBand.Name = "TitleBand";
page.Components.Add(TitleBand);
StiText headerText = new StiText(new RectangleD(0, 0, page.Width, 0.85));
headerText.Text = "Report Name ";
headerText.HorAlignment = StiTextHorAlignment.Center;
headerText.Name = "TitleHeader";
headerText.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold);
StiText DateText = new StiText(new RectangleD(0.3, 0.3, page.Width, 0.2));
DateText.Text = "{Today}";
DateText.HorAlignment = StiTextHorAlignment.Center;
DateText.Name = "DateText";
DateText.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold);
TitleBand.Components.Add(headerText);
TitleBand.Components.Add(DateText);
StiHeaderBand headerBand = new StiHeaderBand();
headerBand.Height = 0.5;
headerBand.Name = "HeaderBand";
page.Components.Add(headerBand);
StiColumnHeaderBand ColumnBand = new StiColumnHeaderBand();
ColumnBand.Height = 1;
page.Components.Add(ColumnBand);
StiDataBand dataBand = new StiDataBand();
dataBand.DataSourceName = "Per";
dataBand.Height = 0.2;
dataBand.Name = "DataPer";
page.Components.Add(dataBand);
double pos = 0;
double columnWidth = page.Width / dt.Columns.Count;
int nameIndex = 1;
for (int i = dt.Columns.Count - 1; i >= 0; i--)
{
DataColumn dataColumn = dt.Columns;
//Add Text Component To DataBound
StiText dataText = new StiText(new RectangleD(pos, 0, columnWidth, 0.4));
dataText.Text = "{Per." + Stimulsoft.Report.CodeDom.StiCodeDomSerializator.ReplaceSymbols(dataColumn.ColumnName) + "}";
dataText.Name = "DataText" + nameIndex.ToString();
dataText.HorAlignment = StiTextHorAlignment.Center;
dataText.VertAlignment = StiVertAlignment.Center;
dataText.Brush = new StiSolidBrush(Color.Aqua);
dataText.Border.Side = StiBorderSides.All;
dataText.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 12, 12, 12), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black), false);
dataText.Font = new System.Drawing.Font("Tahoma", 9F);
dataText.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
dataText.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(255, 64, 64, 64));
dataText.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F, System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
dataBand.Components.Add(dataText);
//Add Text Component To ColumnBound
StiText dataText2 = new StiText(new RectangleD(pos, 0, columnWidth, 0.4));
dataText2.Text = dt.Columns.ColumnName;
dataText2.Name = "DataText" + (dt.Columns.Count + nameIndex).ToString();
dataText2.HorAlignment = StiTextHorAlignment.Center;
dataText2.VertAlignment = StiVertAlignment.Center;
dataText2.Brush = new StiSolidBrush(Color.Aqua);
dataText2.Border.Side = StiBorderSides.All;
dataText2.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 12, 12, 12), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black), false);
dataText2.Font = new System.Drawing.Font("Tahoma", 9F);
dataText2.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
dataText2.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(255, 64, 64, 64));
dataText2.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F, System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);
ColumnBand.Components.Add(dataText2);
pos = pos + columnWidth;
nameIndex++;
dataColumn = new DataColumn();
dataText = new StiText();
}
report.Compile();
report.Dictionary.Synchronize();
StiWebViewer1.Report = report;
Re: WebReportViewer Hide When Sorting An Column
Posted: Thu Aug 13, 2015 12:43 pm
by mghusername
Thanks For Answer
Re: WebReportViewer Hide When Sorting An Column
Posted: Fri Aug 14, 2015 5:57 am
by HighAley
Hello.
Please, send us your report template with link on this topic to
support@stimulsoft.com.
Thank you.
Re: WebReportViewer Hide When Sorting An Column
Posted: Wed Sep 02, 2015 2:31 am
by RichChen
Hello.
Please, send us your report template with link on this topic to
2302874773@qq.com.I really need
Thank you.
Re: WebReportViewer Hide When Sorting An Column
Posted: Wed Sep 02, 2015 2:43 am
by RichChen
Hello, please give me your Template。

Re: WebReportViewer Hide When Sorting An Column
Posted: Wed Sep 02, 2015 9:37 am
by HighAley
Hello, RichChen.
Could you specify what report template you need?
Thank you.