Dynamically add/ remove Text component from Databand
Dynamically add/ remove Text component from Databand
Hi,
Could you please tell me how we can dynamically add/ remove Text components from databand.
Thanks in advance
Could you please tell me how we can dynamically add/ remove Text components from databand.
Thanks in advance
Re: Dynamically add/ remove Text component from Databand
Hello.
Sorry, maybe we did not exactly understand your question. Could you explain your issue more detailed?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue more detailed?
Thank you.
Re: Dynamically add/ remove Text component from Databand
Hi,
I need to generate a report based on the data retrieved from a SQL stored procedure. The number of columns returned by the proc vary each time. Accordingly I need to change the number of columns displayed. That is why I asked how text components can be dynamically added in the databand under a group header. Can you please let me know how this can be handled?
Thanks
I need to generate a report based on the data retrieved from a SQL stored procedure. The number of columns returned by the proc vary each time. Accordingly I need to change the number of columns displayed. That is why I asked how text components can be dynamically added in the databand under a group header. Can you please let me know how this can be handled?
Thanks
Re: Dynamically add/ remove Text component from Databand
Hello,
Please see the sample report in attachment.
Thank you.
Please see the sample report in attachment.
Thank you.
- Attachments
-
- DynamicCreateReport.zip
- (15.46 KiB) Downloaded 589 times
Re: Dynamically add/ remove Text component from Databand
Thanks for the sample report. I will get back in case of any queries.
Re: Dynamically add/ remove Text component from Databand
Hello,
Ok. Let us know if you need any additional help.
Ok. Let us know if you need any additional help.
Re: Dynamically add/ remove Text component from Databand
Hi,
I am working on a web application and tried as mentioned in the sample. But I am getting the error "DragDrop registration did not succeed" in report.Show(). My code is as shown below. Please let me know if I have missed anything:
Thanks
I am working on a web application and tried as mentioned in the sample. But I am getting the error "DragDrop registration did not succeed" in report.Show(). My code is as shown below. Please let me know if I have missed anything:
Code: Select all
StiReport report = new StiReport();
report.Dictionary.Clear();
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("SQLConnection", SqldBConnectString));
DataSet dsBSReport = null;
StiPage LiabRep = report.Pages[0];
dsBSReport = objBSReport.m_BalanceSheetReport(11, "1/5/2013", "GL", true, "ABC");
DataTable dtRepDet = dsBSReport.Tables[0];
DataTable dtUserPC = dsBSReport.Tables[1];
DataTable dtRepLiab = dsBSReport.Tables[2];
DataTable dtRepAsst = dsBSReport.Tables[3];
report.RegData(dsBSReport);
report.Dictionary.Synchronize();
//Create header group for headers
StiHeaderBand LiabRepHeader = new StiHeaderBand();
LiabRepHeader.Height = 0.7;
LiabRepHeader.Name = "LiabReportHeader";
LiabRep.Components.Add(LiabRepHeader);
double columnWidth = LiabRep.Width / ((dtUserPC.Rows.Count + 1) * 2);
double pos = 0;
// Add databand in the header text
StiDataBand dbLiabRepHeader = new StiDataBand();
dbLiabRepHeader.Height = 0.7;
dbLiabRepHeader.Name = "dbLiabRepHeader";
LiabRepHeader.Components.Add(dbLiabRepHeader);
// Add 'Liabilities' header text
StiText stitxtLiab = new StiText(new RectangleD(pos, 0, (columnWidth * 2), 0.7));
stitxtLiab.Text = "Liabilities";
stitxtLiab.HorAlignment = StiTextHorAlignment.Center;
stitxtLiab.VertAlignment = StiVertAlignment.Center;
stitxtLiab.Border.Side = StiBorderSides.All;
dbLiabRepHeader.Components.Add(stitxtLiab);
// Add header text for each of the PCs
int nameIndex = 1;
foreach (DataRow drUserPC in dtUserPC.Rows)
{
pos = pos + (columnWidth * 2);
StiText hText = new StiText(new RectangleD(pos, 0, (columnWidth * 2), 0.7));
hText = new StiText(new RectangleD(pos, 0, columnWidth, 0.5));
hText.Text.Value = drUserPC["ProfitCenter"].ToString() + "/n Amount in Rs.";
hText.HorAlignment = StiTextHorAlignment.Center;
hText.Name = "HeaderText" + nameIndex.ToString();
hText.Border.Side = StiBorderSides.All;
dbLiabRepHeader.Components.Add(hText);
nameIndex++;
}
report.Compile();
report.Show();
Re: Dynamically add/ remove Text component from Databand
Hello,
Please send us a sample project which reproduces the issue.
Also please check the sample in attachment.
Thank you.
Please send us a sample project which reproduces the issue.
Also please check the sample in attachment.
Thank you.
- Attachments
-
- DynamicCreateReportWeb.zip
- (320.95 KiB) Downloaded 399 times