Panel under page border

Stimulsoft Reports.JS discussion
Post Reply
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Panel under page border

Post by Inhabe »

Hi, i'm generating report via js and i have issue when i place panel as picture from my data table it looks like 1.PNG
with some experements i tried to place it out of panel, or in panel with canGrow. Result is on 2.PNG. There is property in documentation named Break if Less Than Property. I tried to use it with dataBand to check if there is any space for my image, but it seems any value passed does nothing for me. Any advice how can i fix this with not breaking table on right side and full display of left? Images are SVG if it is important
Attachments
with canGrow
with canGrow
2.PNG (23.19 KiB) Viewed 3036 times
On panel
On panel
1.PNG (31.9 KiB) Viewed 3036 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Panel under page border

Post by Alex K. »

Hello,

Please send us your report template with test data which reproduces the issue for analysis.

Thank you.
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Re: Panel under page border

Post by Inhabe »

There is no template, dynamically genered in js report. Ok, how do you put 2 table side by side without template? As breakIfLessThan and canBreak does nothing here

Code: Select all

var patientData = dataSet.tables.getByIndex(tableIndex);
                        var patientDataSource = new Stimulsoft.Report.Dictionary.StiDataTableSource(patientData.tableName, patientData.tableName, patientData.tableName);
                        for (var i = 0; i < patientData.columns.count; i++) {
                            var ind = i + 2;
                            patientDataSource.columns.add(new Stimulsoft.Report.Dictionary.StiDataColumn("Column" + ind));
                        }

                        report.dictionary.dataSources.add(patientDataSource);
                        var patientDataBand = new Stimulsoft.Report.Components.StiDataBand();
                        patientDataBand.dataSourceName = patientData.tableName;
                        patientDataBand.canBreak = true;
                        patientDataBand.breakIfLessThan = 50;
                        //patientDataBand.height = 0.5;
                        //patientDataBand.breakIfLessThan = 100;
                        patientDataBand.name = "PatientDataBand";
                        page.components.add(patientDataBand);
                        
                        var panel = new Stimulsoft.Report.Components.StiPanel();
                        //panel.canGrow = true;

                        patientDataBand.components.add(panel);

                        //panel.components.add(patientDataBand);
                        //page.components.add(panel);
                        var pos = 0;
                        var nameIndex = 1;
                        for (var index in patientData.columns.list) {
                            var patientDataColumn = patientData.columns.list[index];
                            //Create text on Data Band
                            var patientText = new Stimulsoft.Report.Components.StiText();
                            patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 2, 0.5);
                            patientText.border.side = 0;
                            if (index == 0) {
                                var sampleImage = new Stimulsoft.Report.Components.StiImage();
                                sampleImage.imageURL = String.stiFormat("{{0}.{1}}", patientData.tableName, "Column1");
                                sampleImage.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 9, 5);
                                sampleImage.border.side = 15;
                                //sampleImage.stretch = true
                                //sampleImage.aspectRatio = true;
                                var condition = new Stimulsoft.Report.Components.StiCondition();
                                //condition.backColor = Stimulsoft.System.Drawing.Color.cornflowerBlue;
                                condition.font = Stimulsoft.Base.Drawing.StiFontUtils.changeFontStyleBold(condition.font, true);
                                condition.textColor = Stimulsoft.System.Drawing.Color.black;
                                condition.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 9, 0.5);
                                condition.borderSides = 15;
                                condition.enabled = false;
                                condition.expression = "Line != 1";
                                condition.item = Stimulsoft.Report.Components.StiFilterItem.Expression;
                                sampleImage.conditions.add(condition);
                                //  panel.conditions.add(condition);

                                panel.components.add(sampleImage);

                                //patientDataBand.components.add(sampleImage);

                                //var footerBand = new Stimulsoft.Report.Components.StiFooterBand();
                                //footerBand.height = 3;
                                //footerBand.name = "FooterBand";
                                //patientDataBand.components.add(footerBand);
                                pos += 4.5;
                            }
                            patientText.border.side = 15;
                            if (index == 0) { patientText.border.side = 0; }
                            if (index == 1) { patientText.border.side = 13; }
                            if (index == 3) { patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 1, 0.5); patientText.border.side = 15; }
                            if ((patientData.columns.count == 5) && (index == 3)) {
                                patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 2.5, 0.5);
                            }
                            if (index == 5) { patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 0.5, 0.5); }
                            if ((index == 4) || (index == 1)) { patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 2.5, 0.5); }
                            if (index == 1) { patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 3, 0.5); }
                            if (index == 5) { patientText.border.side = 11; }
                            if ((patientData.columns.count == 5) && (index == 4)) {
                                patientText.clientRectangle = new Stimulsoft.System.Drawing.Rectangle(pos, 0, 1.5, 0.5);
                                patientText.border.side = 11;
                            }
                            patientText.text = String.stiFormat("{{0}.{1}}", patientData.tableName, patientDataColumn.columnName);
                            //patientText.canGrow = true;
                            patientText.wordWrap = true;
                            //patientText.horAlignment = Stimulsoft.Base.Drawing.StiTextHorAlignment.Center;
                            //dataText.font.bold = true; Установить стиль шрифта
                            patientText.margins.top = 4;  //Установить отступ независимый от таблицы выше
                            patientText.margins.left = 4;
                            var condition = new Stimulsoft.Report.Components.StiCondition();
                            //condition.backColor = Stimulsoft.System.Drawing.Color.cornflowerBlue;
                            condition.font = Stimulsoft.Base.Drawing.StiFontUtils.changeFontStyleBold(condition.font, true);
                            condition.textColor = Stimulsoft.System.Drawing.Color.black;
                            condition.borderSides = 15;
                            if (index == 0) { condition.borderSides = 0; patientText.text = ""; }
                            if (index == 1) { condition.borderSides = 13; }
                            if ((patientData.columns.count == 5) && (index == 4)) { condition.borderSides = 11; }
                            if (index == 5) { condition.borderSides = 11; }
                            condition.expression = "Line == 1";
                            condition.item = Stimulsoft.Report.Components.StiFilterItem.Expression;
                            patientText.conditions.add(condition);

                            //panel.components.add(patientText);

                            patientDataBand.components.add(patientText);
                            if (index == 0) { pos += 3; }
                            if (index == 1) { pos += 0.5; }
                            if (index == 2) { pos -= 0.5; }
                            if (index == 5) { pos -= 1; }
                            if ((patientData.columns.count == 5) && (index == 3)) { pos += 1.5; }
                            if (index == 3) { { pos -= 1.5; } }
                            pos = pos + 2.5;
                            nameIndex++;
                        }
                        //Create FooterBand
                        var footerBand = new Stimulsoft.Report.Components.StiFooterBand();
                        var rowsCount = patientData.rows.count;
                        var PJheight = 3.25;
                        if (rowsCount > 9) { PJheight = 0.25; }
                        footerBand.height = PJheight;
                        footerBand.name = "FooterBand";
                        page.components.add(footerBand);
                        tableIndex += 1;
                    }
Not clearest code ever, but i think its clear what conrains what
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Panel under page border

Post by HighAley »

Hello.

Please, add another panel and out your DataBand there.
You could save the report template to see what you get.
You could see what changes you should do in your code.
If you need more detailed answer, please send us a working project that reproduces your issue.

Thank you.
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Re: Panel under page border

Post by Inhabe »

Here it is. Please help, i almost lost any sanity trying to figure out how it shoul be done. =)
Attachments
SampleApp.zip
(5.4 MiB) Downloaded 175 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Panel under page border

Post by HighAley »

Hello.

As a way, you could move your chart on the Header band and set the Can Grow property of the Header band to False.
Please, look at the attached report template.

Thank you.
Attachments
Report (1).mrt
(8.84 KiB) Downloaded 149 times
Inhabe
Posts: 11
Joined: Wed Nov 08, 2017 10:41 am

Re: Panel under page border

Post by Inhabe »

Hello, thanks for helping. Unfortunatly it still stays in same position even after i moved pic into headerBand. Setted props as in template you sended me earlier and nothing. Could you please take a look once more?
Attachments
SampleApp.zip
(5.41 MiB) Downloaded 154 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Panel under page border

Post by HighAley »

Hello.

What behaviour do you waiting for? If you want to move the image to the other page, you could put a Panel of the HeaderDataBand, set the Can Grow and Can Break properties to true and move the PJDataBand to the Panel. Please, look at the attached report template.

Thank you.
Attachments
Report (1).mrt
(7.68 KiB) Downloaded 160 times
Post Reply