Page 1 of 2
Fill upp empty columns
Posted: Mon Jan 28, 2008 3:37 am
by incognito_gbg
In a databand that has four columns, is it possible to fill up empty columns for a row. So that if i have five values that fills columns 1, 2, 3 and 4 for the first row, and just column 1 for row 2, then column 2, 3 and 4 for the second row are generated but with empty values.
I need it so that the border round the databand is generated around the whole row, not just around the first, second or third column.
Fill upp empty columns
Posted: Mon Jan 28, 2008 9:51 am
by Edward
In that case in the BeginRender event of the page you can check the Count of the records in the DataSource and if it is not divided by 4, then add rows to it.
Each DataSource has a property Datatable which could be modified.
Code: Select all
while ((Categories.Count % 4) != 0)
{
Categories.DataTable.Rows.Add(Categories.DataTable.NewRow());
}
Here Categories - is a DataSource row count on which we must to increase.
Thank you.
Fill upp empty columns
Posted: Tue Jan 29, 2008 2:55 am
by incognito_gbg
Hmm. Didnt get that to work. It doesnt give any errors in the designer or during runtime, but I still just get borders around the columns that have values from the xml-file, and not around the whole row that I need for it to look good.
Fill upp empty columns
Posted: Thu Jan 31, 2008 3:11 am
by Edward
incognito_gbg wrote:Hmm. Didnt get that to work. It doesnt give any errors in the designer or during runtime, but I still just get borders around the columns that have values from the xml-file, and not around the whole row that I need for it to look good.
Please see the report template from the attachment. You can open it in the Demo.exe sample application from the standard delivery of the Stimulsoft Reports.Net.
There is also an Event Handler BeforePrint for the Text Component.
Thank you.
Fill upp empty columns
Posted: Wed Feb 06, 2008 9:33 am
by incognito_gbg
Tried to open it with demo.exe, but that application seemed to only accept .mdz or .mdc, not .mrt.
Fill upp empty columns
Posted: Wed Feb 06, 2008 9:46 am
by Edward
Yes, it is true for the Preview window. But if you press 'Designer' button in the bottom of the Preview window in the Demo.exe application, then you'll get access to the Designer.
In Designer it is possible to Save/Open reports in mrt and mrz (compressed) format.
Thank you.
Fill upp empty columns
Posted: Thu Feb 07, 2008 3:41 am
by incognito_gbg
Well, the report you sent works perfectly in demo.exe. It does just what I want.
But I can“t repeat it in my own report. All it does is drawing the left border.
Update: It does create the extra rows needed for the columns. But it doesnt draw around the new columns based on the event-created rows. It just draws around the columns which are based on rows with values.
Fill upp empty columns
Posted: Fri Feb 08, 2008 2:08 am
by Edward
There is the following code inside the report I'd attached:
BeforePrint of the text component:
if (Column == 1)
{
Text2.Border = new Stimulsoft.Base.Drawing.StiBorder((((Stimulsoft.Base.Drawing.StiBorderSides.None | Stimulsoft.Base.Drawing.StiBorderSides.Top)
| Stimulsoft.Base.Drawing.StiBorderSides.Bottom)| Stimulsoft.Base.Drawing.StiBorderSides.Left), System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
}
else
{
if (Column == 4)
{
Text2.Border = new Stimulsoft.Base.Drawing.StiBorder((((Stimulsoft.Base.Drawing.StiBorderSides.None | Stimulsoft.Base.Drawing.StiBorderSides.Top)
| Stimulsoft.Base.Drawing.StiBorderSides.Bottom)| Stimulsoft.Base.Drawing.StiBorderSides.Right), System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
}
else
{
Text2.Border = new Stimulsoft.Base.Drawing.StiBorder(((Stimulsoft.Base.Drawing.StiBorderSides.None | Stimulsoft.Base.Drawing.StiBorderSides.Top)
| Stimulsoft.Base.Drawing.StiBorderSides.Bottom), System.Drawing.Color.Black, 1, Stimulsoft.Base.Drawing.StiPenStyle.Solid, false, 4, new Stimulsoft.Base.Drawing.StiSolidBrush(System.Drawing.Color.Black));
}
}
Begin Render event of the Page component:
while ((Employees.Count % 4) != 0)
{
Employees.DataTable.Rows.Add(Employees.DataTable.NewRow());
}
This code will add as much records, as needed to the Employees DataSource to fill all Columns completelely. In this example we have 4 columns.
Thank you.
Fill upp empty columns
Posted: Thu Feb 14, 2008 4:48 am
by incognito_gbg
Yes, Im getting the new records that I need, but the new borders doesnt get any borders. My original records get the correct borders (only top and bottom on column 2 and 3), but there is nothing around the others.
Fill upp empty columns
Posted: Thu Feb 14, 2008 6:41 pm
by Edward
Please send your report template and the data for it is possible to support[at]stimulsoft.com for analysis.
Thank you.