Report Page's component render position is different

Stimulsoft Reports.WPF discussion
Post Reply
LIM HT
Posts: 16
Joined: Fri Aug 23, 2013 10:51 am

Report Page's component render position is different

Post by LIM HT »

Hello.

we try to make barcode reports with several pages (code behind).

but barcode position is different from first page to another.

we have to set start position X or Y of components after insert new pages?

Code: Select all

            StiReport report = new StiReport();

            StiPage page = report.Pages[0];

                        Stimulsoft.Report.BarCodes.StiBarCode test = 
new Stimulsoft.Report.BarCodes.StiBarCode(new RectangleD(0, Add_index, 10, 0.85));
                        test.Code = barCodevar;
                        test.AutoScale = false;
                        //test.CodeValue = test.BarCodeType.GetCode(test);
                        test.BarCodeType = new Stimulsoft.Report.BarCodes.StiCode39ExtBarCodeType();
                        test.CodeValue = test.BarCodeType.GetCode(test);
                        page.Components.Add(test);
and page's width and height is not working... code is..

Code: Select all

        report.Pages[i].Height = 400;
                report.Pages[i].Width = 400;
thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report Page's component render position is different

Post by Alex K. »

Hello,

Please try to place the DataBand component on the page and then put your barcode on this databand.

Thank you.
LIM HT
Posts: 16
Joined: Fri Aug 23, 2013 10:51 am

Re: Report Page's component render position is different

Post by LIM HT »

How to databand binding barcode?

Code: Select all

StiBarCodeExpression barCodevar = new StiBarCodeExpression();
                        barCodevar.Value = item["SPCM_NO"].ToString();
                        
                        StiText Uppertext = new StiText(new RectangleD(0, 0, 10, 0.85));
                        Uppertext.Text = string.Format("{0}{1}", item["PT_ID"].ToString(), item["PT_KANA_NM"].ToString());
                        Uppertext.HorAlignment = StiTextHorAlignment.Left;
                        Uppertext.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
                        page.Components.Add(Uppertext);

                        StiDataBand dataBand = new StiDataBand(new RectangleD(0, 0.5, 10, 0.85));
                        //dataBand..DataSourceName = "ReportTable";
                        dataBand.Height = 0.5;
                        //dataBand.Name = "DataBand";
                       

                        //Stimulsoft.Report.BarCodes.StiBarCode test = new Stimulsoft.Report.BarCodes.StiBarCode(new RectangleD(0, 0.5, 10, 0.85));
                        Stimulsoft.Report.BarCodes.StiBarCode test = new Stimulsoft.Report.BarCodes.StiBarCode();
                        test.Code = barCodevar;
                        test.AutoScale = false;
                        Stimulsoft.Report.BarCodes.StiCode39BarCodeType test002 = new Stimulsoft.Report.BarCodes.StiCode39BarCodeType();
                        test.BarCodeType = test002;

                        test.Name = string.Format("test{0}", i);
                        test.CodeValue = test002.GetCode(test);

                        dataBand.DataSourceName = test.Name;
                        dataBand.Components.Add(test);
                        page.Components.Add(dataBand);
                        //test.CodeValue = test002.GetCode(test);
                        //dataBand.Components.Add(test);
                        //page.Components.Add(test);

                        StringBuilder sb = new StringBuilder();
                        sb.Clear();
                        sb.Append(item["SPCM_NO"].ToString());
                        sb.Append(" (");
                        sb.Append(item["SEX"].ToString());
                        sb.Append("/");
                        sb.Append(item["AGE"].ToString());
                        sb.Append(") ");
                        sb.Append(item["MED_DP_ABBR_NM"].ToString());
                        sb.Append("/");
                        if (item["WARD_ABBR_NM"] != null)
                            sb.Append(item["WARD_ABBR_NM"].ToString());
                        else
                            sb.Append("");
                        sb.Append("\n");
                        sb.Append(item["PRSC_ASST_NM"].ToString());
                        sb.Append(item["SPCM_CTNR_NM"].ToString());
                        sb.Append("\n");
                        sb.Append(item["ABBR_PRSC_NM"].ToString());
                        StiText enderText = new StiText(new RectangleD(0, 1.5, 10, 0.85));
                        enderText.Text = sb.ToString();
                        enderText.HorAlignment = StiTextHorAlignment.Left;
                        enderText.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
                        page.Components.Add(enderText);
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Report Page's component render position is different

Post by Alex K. »

Hello,

You can create the necessary report in designer then open the Code tab and use the similar code in your project.

Thank you.
Post Reply