Telerik Forums
Reporting Forum
1 answer
483 views
My report layout is attached
I need to have this in a4 sheet

Section 1 - Constant Height (Bottom of A4)
Section 2 - It will vary its height according to list of data (Above section 1)
Section 3 - Picture should occupy remaining A4 page sheet (Remaining part of the paper)

What is did was
Section 1 is docked bottom
Section 2 is docked bottom (above section 1)
Section 3 is docked fill

Attached my output

When my Section 2 is bigger then details are showed by generating the second page
I need to fit all in a single page by reducing the picture size(section 3)


Is there any way to get the size of the table while setting the size of the picture.
private void InitializeComponent()
        {
            Telerik.Reporting.TableGroup tableGroup1 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup2 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup3 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.TableGroup tableGroup4 = new Telerik.Reporting.TableGroup();
            Telerik.Reporting.Drawing.TextWatermark textWatermark1 = new Telerik.Reporting.Drawing.TextWatermark();
            Telerik.Reporting.Drawing.StyleRule styleRule1 = new Telerik.Reporting.Drawing.StyleRule();
            this.textBox1 = new Telerik.Reporting.TextBox();
            this.textBox3 = new Telerik.Reporting.TextBox();
            this.textBox4 = new Telerik.Reporting.TextBox();
            this.pageHeaderSection1 = new Telerik.Reporting.PageHeaderSection();
            this.detail = new Telerik.Reporting.DetailSection();
            this.panel11 = new Telerik.Reporting.Panel();
            this.pictureBox1 = new Telerik.Reporting.PictureBox();
            this.table1 = new Telerik.Reporting.Table();
            this.textBox5 = new Telerik.Reporting.TextBox();
            this.textBox6 = new Telerik.Reporting.TextBox();
            this.textBox7 = new Telerik.Reporting.TextBox();
            this.pageFooterSection1 = new Telerik.Reporting.PageFooterSection();
            this.objectDataSource1 = new Telerik.Reporting.ObjectDataSource();
            ((System.ComponentModel.ISupportInitialize)(this)).BeginInit();
            //
            // textBox1
            //
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox1.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            //
            // textBox3
            //
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox3.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox3.Style.BorderStyle.Left = Telerik.Reporting.Drawing.BorderType.None;
            this.textBox3.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            //
            // textBox4
            //
            this.textBox4.Name = "textBox4";
            this.textBox4.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox4.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox4.Style.BorderStyle.Left = Telerik.Reporting.Drawing.BorderType.None;
            this.textBox4.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            //
            // pageHeaderSection1
            //
            this.pageHeaderSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(0.30000004172325134D);
            this.pageHeaderSection1.Name = "pageHeaderSection1";
            //
            // detail
            //
            this.detail.Height = Telerik.Reporting.Drawing.Unit.Inch(8.99375057220459D);
            this.detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.panel11,
            this.pictureBox1,
            this.table1});
            this.detail.Name = "detail";
            this.detail.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Inset;
            //
            // panel11
            //
            this.panel11.Bindings.Add(new Telerik.Reporting.Binding("Location", "= Rexroth.Hydraulics.PumpsAndMotors.CalculationPrograms.Leist.Views.Report11.RepositionPanelFactor(Fields.ObjData.Count, ReportItem)"));
            this.panel11.Docking = Telerik.Reporting.DockingStyle.Bottom;
            this.panel11.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0D), Telerik.Reporting.Drawing.Unit.Inch(7.8937501907348633D));
            this.panel11.Name = "panel11";
            this.panel11.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.2677168846130371D), Telerik.Reporting.Drawing.Unit.Inch(1.1000001430511475D));
            this.panel11.Style.BackgroundColor = System.Drawing.Color.Silver;
            this.panel11.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Inset;           
            //
            // table1
            //
            //this.table1.Anchoring = Telerik.Reporting.AnchoringStyles.Top;
            this.table1.Docking = Telerik.Reporting.DockingStyle.Fill;
            this.table1.Bindings.Add(new Telerik.Reporting.Binding("DataSource", "=Fields.ObjData"));
            this.table1.Bindings.Add(new Telerik.Reporting.Binding("Location", "= Rexroth.Hydraulics.PumpsAndMotors.CalculationPrograms.Leist.Views.Report11.RepositionTableFactor(Fields.ObjData.Count,ReportItem)"));
            this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(0.79998701810836792D)));
            this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(0.79998701810836792D)));
            this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Telerik.Reporting.Drawing.Unit.Inch(0.79998701810836792D)));
            this.table1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D)));
            this.table1.Body.SetCellContent(0, 0, this.textBox5);
            this.table1.Body.SetCellContent(0, 1, this.textBox6);
            this.table1.Body.SetCellContent(0, 2, this.textBox7);
            tableGroup1.ReportItem = this.textBox1;
            tableGroup2.ReportItem = this.textBox3;
            tableGroup3.ReportItem = this.textBox4;
            this.table1.ColumnGroups.Add(tableGroup1);
            this.table1.ColumnGroups.Add(tableGroup2);
            this.table1.ColumnGroups.Add(tableGroup3);
            this.table1.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.textBox5,
            this.textBox6,
            this.textBox7,
            this.textBox1,
            this.textBox3,
            this.textBox4});
            this.table1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.067756019532680511D), Telerik.Reporting.Drawing.Unit.Inch(7.2937507629394531D));
            this.table1.Name = "table1";
            tableGroup4.Groupings.Add(new Telerik.Reporting.Grouping(null));
            tableGroup4.Name = "DetailGroup";
            this.table1.RowGroups.Add(tableGroup4);
            this.table1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(2.39996075630188D), Telerik.Reporting.Drawing.Unit.Inch(0.599920928478241D));
            this.table1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            //
            // pictureBox1
            //
            this.pictureBox1.Docking = Telerik.Reporting.DockingStyle.Top;
            this.pictureBox1.Bindings.Add(new Telerik.Reporting.Binding("Size", "= Rexroth.Hydraulics.PumpsAndMotors.CalculationPrograms.Leist.Views.Report11.ResizePictureFactor(Fields.ObjData.Count,ReportItem)"));
            this.pictureBox1.Bindings.Add(new Telerik.Reporting.Binding("Value", "=Fields.MyImage"));
            //this.pictureBox1.Bindings.Add(new Telerik.Reporting.Binding("Location", "= Rexroth.Hydraulics.PumpsAndMotors.CalculationPrograms.Leist.Views.Report11.RepositionPictureFactor(Fields.ObjData.Count,ReportItem)"));
            this.pictureBox1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(0.0067756019532680511D), Telerik.Reporting.Drawing.Unit.Inch(3.9418537198798731E-05D));
            this.pictureBox1.MimeType = "";
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(6.1999607086181641D), Telerik.Reporting.Drawing.Unit.Inch(7.1999607086181641D));
            this.pictureBox1.Sizing = Telerik.Reporting.Drawing.ImageSizeMode.Stretch;
            this.pictureBox1.Style.BorderColor.Default = System.Drawing.Color.Maroon;
            this.pictureBox1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            this.pictureBox1.Style.BorderWidth.Default = Telerik.Reporting.Drawing.Unit.Point(1D);
            this.pictureBox1.Value = "=Fields.MyImage";
            //
            // textBox5
            //
            this.textBox5.Name = "textBox5";
            this.textBox5.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox5.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox5.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            this.textBox5.Value = "=Fields.Speed";
            //
            // textBox6
            //
            this.textBox6.Name = "textBox6";
            this.textBox6.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox6.Style.BorderStyle.Bottom = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox6.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None;
            this.textBox6.Style.BorderStyle.Right = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox6.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            this.textBox6.Value = "=Fields.Power";
            //
            // textBox7
            //
            this.textBox7.Name = "textBox7";
            this.textBox7.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(0.79998695850372314D), Telerik.Reporting.Drawing.Unit.Inch(0.29996046423912048D));
            this.textBox7.Style.BorderStyle.Bottom = Telerik.Reporting.Drawing.BorderType.Solid;
            this.textBox7.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.None;
            this.textBox7.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
            this.textBox7.Value = "=Fields.Torque";
            //
            // pageFooterSection1
            //
            this.pageFooterSection1.Height = Telerik.Reporting.Drawing.Unit.Inch(0.2999996542930603D);
            this.pageFooterSection1.Name = "pageFooterSection1";
            //
            // objectDataSource1
            //
            this.objectDataSource1.DataSource = typeof(Reports.MyObjects);
            this.objectDataSource1.Name = "objectDataSource1";
            //
            // Report1
            //
            this.DataSource = this.objectDataSource1;
            this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
            this.pageHeaderSection1,
            this.detail,
            this.pageFooterSection1});
            this.Name = "Report11";
            this.PageSettings.Landscape = false;
            this.PageSettings.Margins = new Telerik.Reporting.Drawing.MarginsU(Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(1D), Telerik.Reporting.Drawing.Unit.Inch(0D));
            this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
            textWatermark1.Text = "Approved";
            this.PageSettings.Watermarks.Add(textWatermark1);
            this.Style.BackgroundColor = System.Drawing.Color.White;
            styleRule1.Selectors.AddRange(new Telerik.Reporting.Drawing.ISelector[] {
            new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.TextItemBase)),
            new Telerik.Reporting.Drawing.TypeSelector(typeof(Telerik.Reporting.HtmlTextBox))});
            styleRule1.Style.Padding.Left = Telerik.Reporting.Drawing.Unit.Point(2D);
            styleRule1.Style.Padding.Right = Telerik.Reporting.Drawing.Unit.Point(2D);
            this.StyleSheet.AddRange(new Telerik.Reporting.Drawing.StyleRule[] {
            styleRule1});
            this.Width = Telerik.Reporting.Drawing.Unit.Inch(6.2677168846130371D);
            ((System.ComponentModel.ISupportInitialize)(this)).EndInit();
 
        }
Elian
Telerik team
 answered on 09 May 2013
7 answers
143 views
Hi,
I am using telerik trial version an try to create a test report. I spend 3 days to do this but did not success.

My scenario is like:
1) I have a WCF Project called "ReportWCF" which is use to connect mysql database and collect data and return in generic list method say "lstGetOrder".

2) I have another project "ReportLibrary" which contain "OrderReport1.cs" and "OrderList.cs" which is use to hold data returned from WCF call back.

Till now everything is fine.
But before my WCF execution is finished my report viewer is appeared in my Silverlight application. I think but not sure it is for Async call because if I put a break point on the "OrderList.cs" after a while the break point will hit but the blank report already rendered in Silverlight?

I use objectdatasource hear.

**************************************************************

How can I do this to overcome this problem.
I was already tried the "ReportServiceClient" implementation in Silverlight page but there is an error called:
Could not find default endpoint element that references contract 'Telerik.Reporting.Service.SilverlightClient.IReportService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Use like Report.xaml.cs:
ReportServiceClient IReportServiceClientFactory.Create(System.Uri remoteAddress)
        {
            var binding = new BasicHttpBinding() // or BasicHttpBinding(BasicHttpSecurityMode.Transport) overload if SSL is used
            {
                MaxBufferSize = int.MaxValue,
                MaxReceivedMessageSize = int.MaxValue,
                ReceiveTimeout = new TimeSpan(0, 15, 0),
                SendTimeout = new TimeSpan(0, 15, 0)
            };

            var endpointAddress = new EndpointAddress(remoteAddress);

            return new ReportServiceClient(binding, endpointAddress);
        }

private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
{
          ReportServiceClient client = new ReportServiceClient();
}

In this case how to fix the error and how to call WCF method?
and how can I call my wcf method with this "client" proxy object. My WCF method is CreateReport();
I want to use like client.CreateReportCompleted += .........  ;  client.CreateReportAsync();

Can you please send me a sample application to do get data from WCF call back and populate report?

I have see all the sample but unable to understand.
like : http://www.telerik.com/help/reporting/silverlight-report-viewer.html
http://www.telerik.com/help/reporting/silverlight-wcf-service-overview.html
etc.
Please send me solution asap.
Thanks in advance
Chandan
Peter
Telerik team
 answered on 08 May 2013
4 answers
1.1K+ views
Where are Connection Strings stored after adding in Report Designer?

I have searched my local drive after adding a new entry and can't seem to find the config file anywhere.

Thanks
-Justin
Consinco S/A
Top achievements
Rank 1
 answered on 07 May 2013
3 answers
201 views
Hello telerik

According to your examples, you know the location of elements, their values and element count.
But when I create report, I don't know how many columns will be in my report. Usually 20-40 columns.
A piece of code: (I write by hand, to don't copy the entire code)

//by default standard portrait A4
private void BuilderReport(Telerik.Reporting.IReportDocument report)
{
    report.Width = new Unit(Columns.Count * 1.2, UnitType.Inch); // ≈ 20-25 Inch
 
    // ...
     
    foreach (var column in Columns)
    {
        var dataTextBox = new TextBox { /* Size, Location etc */ };
        report.Items["detail"].Items.Add(dataTextBox);
 
        // ...
        var footerTextBox = new TextBox { /* Size, Location etc */ };
        footerTextBox.Value = string.Format(@"=PageExec(""{0}"", Count(Fields.{0}))", column.Name);
 
        // pageFooter is Telerik.Reporting.PageFooterSection
        report.Items["pageFooter"].Items.Add(footerTextBox);
    }
}


Only each first page contains correctly aggregate values, other pages contsins 0
If replace PageFooterSection to Telerik.Reporting.GroupFooterSection all aggregate items is equals 0

How correctly calculate aggregates, when have too many columns and they are transferred on other pages?

Thanks
Stef
Telerik team
 answered on 07 May 2013
1 answer
61 views
Hi
When I publish the report page, It could't show icon in toolbar,but it work fine in my development environment.
Just like attachment.

<system.webServer>
<handlers>
      <add name="Telerik.ReportViewer.axd_*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.611, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" path="Telerik.ReportViewer.axd" verb="*"  preCondition="integratedMode,runtimeVersionv2.0"/>
 
</handlers>
</system.webServer>
 
<system.web>
<httpHandlers>
 
    <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=6.1.12.611, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="false"/>
 
</httpHandlers>
</system.web>

 
Stef
Telerik team
 answered on 07 May 2013
1 answer
150 views
I am using Telerik Reporting Q1 2013.  I need to create a crosstable that shows the colums and rows in a specific order.  I cannot use the ascending or descending format.  I am using pre and post data.  Is it possible to specify the order of the row and column data.  I have attached an image of the table that I want to create.  As you can see, I can not order them alphabetically.

Thanks,
Jennifer
IvanY
Telerik team
 answered on 06 May 2013
0 answers
99 views
Hello Telerik,

First of all I am using Q2 2012 version of reporting but I am sure this affects the Q2 2012 SP1 as well. My report is made of a crosstab with a first column which has the following properties enabled : Cangrow, Multiline, TextWrap.
Now the behavior doesn't have any problem when I preview (pic1) the report but when I do the Html rendering (pic2) (which is used in the asp reportviewer it seems) it won't grow normally, some lines will grow a little, others won't grow at all, hiding the text beneath.
So from what I understand, Multiline and Textwrap works well, but Cangrow don't. Also you can see here that the relative size of the text is not the same, being taller in the html rendering, but I can live with that.

Edit : The behavior described above won't apply when the asp ReportViewer is wrapped in an ASP web page, so problem solved.

Thanks in advance for any help,
Cheers.
Jean-Francois
Top achievements
Rank 1
 asked on 06 May 2013
2 answers
212 views
Hello,

I'm working on a Windows Forms Application where I want to load Reports into a Reportviewer after a click on a Button.
This is the Event that gets triggered by pressing on the button in the Code behind of the Windows Form:

private void button1_Click(object sender, EventArgs e)
{
 
    Telerik.Reporting.InstanceReportSource reportSource = new
    Telerik.Reporting.InstanceReportSource();
    reportSource.ReportDocument = new Reportlibrary.Report1();
 
    reportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber","123456789"));
 
    reportViewer1.ReportSource = reportSource;
    reportViewer1.RefreshReport();
 
}

The problem now is that I have no Idea how I can access / get the parameter I added before Refreshing the Reportviewer.
The Report already has set a Datasource. I don't know if this matters.
This is what I have right now. I've tried everything and I'm just not getting further.

public Report1()
        {
            InitializeComponent();
 
            Position[] all = new Position[]{
 
               new Position("Test", "Test","test"),
 
            };
 
            this.DataSource = all;
 
             MessageBox.Show("Number: " +
             this.Report.ReportParameters["OrderNumber"].Value.ToString());
                 
        }

Is there any way to get this parameter straight after InitializeComponent(); ?
Do I need to add another Event to the report to access it? If yes which on is the best way to do this?

Any help very apreciated.
Thank you
Peter
Telerik team
 answered on 06 May 2013
4 answers
119 views
Environment : 
- Mac OSX (Lion and Mountain Lion),
- Safari (Version 6.0 (8536.25)) and Firefox (15.0 Beta 3)  
- Silverlight Ad-On 5.1.10411.0 

no data when exporting

Please help,

Thanks,
Wit
jean-Marc
Top achievements
Rank 1
 answered on 06 May 2013
1 answer
81 views
Hi, I use Telerik Reporting with Silverlight

All is OK, but when i put data into grid (from DataSource) part of the text is cut off on the preview page. And then if I convert it into 
Word or Pdf situation is the same. But if I convert it into Excel then everything is Ok.

Thank you very much for your prompt response!!!
Stef
Telerik team
 answered on 03 May 2013
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?