Page 1 of 1

How to insert cell values code behind

Posted: Wed Jul 24, 2013 8:25 pm
by pizzatto
Hello,

I've attempted to insert text values into a table dynamically without DataSource and i didnt find the correct attribute that i'll fill.

Someone could help me ?

obs:

My cell code:

Stimulsoft.Report.Components.Table.StiTableCell Table1_Cell1 = new Stimulsoft.Report.Components.Table.StiTableCell();
Table1_Cell1.ClientRectangle = new Stimulsoft.Base.Drawing.RectangleD(0, 0, 4.8, 0.8);
Table1_Cell1.ID = 1;
Table1_Cell1.JoinCells = new int[0];
Table1_Cell1.Name = "Table1_Cell1";
Table1_Cell1.Restrictions = (((Stimulsoft.Report.Components.StiRestrictions.None | Stimulsoft.Report.Components.StiRestrictions.AllowMove)
| Stimulsoft.Report.Components.StiRestrictions.AllowSelect)
| Stimulsoft.Report.Components.StiRestrictions.AllowChange);
Table1_Cell1.Border = new Stimulsoft.Base.Drawing.StiBorder(Stimulsoft.Base.Drawing.StiBorderSides.All, System.Drawing.Color.FromArgb(255, 105, 105, 105), 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.FromArgb(255, 105, 105, 105)), false);
Table1_Cell1.Brush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Transparent);
Table1_Cell1.Font = new System.Drawing.Font("Arial", 9F);
Table1_Cell1.Guid = null;
Table1_Cell1.Indicator = null;
Table1_Cell1.Interaction = null;
Table1_Cell1.Margins = new Stimulsoft.Report.Components.StiMargins(0, 0, 0, 0);
Table1_Cell1.TextBrush = new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black);
Table1_Cell1.TextOptions = new Stimulsoft.Base.Drawing.StiTextOptions(false, false, false, 0F, System.Drawing.Text.HotkeyPrefix.None, System.Drawing.StringTrimming.None);

Re: How to insert cell values code behind

Posted: Thu Jul 25, 2013 12:20 pm
by Alex K.
Hello,

Can you please describe your task in more details. Also please check the sample how to create a report in code in the attachment.

Thank you.

Re: How to insert cell values code behind

Posted: Thu Jul 25, 2013 3:13 pm
by pizzatto
Hi, thanks for helping.

I attempted to follow your example, but I got an error "object reference not set instance object"

I attached my example project.(The XSD and XML file are in rar file).

Thanks

Re: How to insert cell values code behind

Posted: Thu Jul 25, 2013 5:58 pm
by pizzatto
Is possible to use StiDataBand without a DataTable or DataSet ??

Re: How to insert cell values code behind

Posted: Mon Jul 29, 2013 6:33 am
by HighAley
Hello.

The error is because you set the same name for the DataSource and the DataBand.

Thank you.