Telerik Forums
Reporting Forum
1 answer
94 views
Hello
I have few questions.

Question 1:
Please see attached image. Is this possible with telerik reports? I have telerik reports in my MVC site.

Question 2:
It is possible to download just individual report from report book example along with all the reports in pdf format?
http://demos.telerik.com/reporting/report-book/demo.aspx

Regards
Mac
Elian
Telerik team
 answered on 29 Mar 2012
3 answers
1.0K+ views
I'm trying to display the PageNumber / PageCount in a textbox in the footer area of the main report. The steps I have taken are:
-drag a textbox to the mainpage's footer area
-rightclick the textbox choose expression..
- go to global objects
- double click PageNumber and PageCount
- manually add a string value so I get "= PageNumber + " / " + PageCount"

When I run the report I get the error:
An error has occurred while processing TextBox 'txtPageNumber':
The expression contains object 'PageNumber' that is not defined in the current context.

Why isn't this working?
Koen L
Top achievements
Rank 1
 answered on 29 Mar 2012
1 answer
129 views
I am trying to bind a type CustomerInvoiceLogs ( : List<CustomerInvoiceLog>) to a crosstab in a subreport.
I start by passing on the data in to the subreport in the subreports NeedDataSource event in the main report design window.

private void subPortfolioStatistics_NeedDataSource(object sender, EventArgs e)
{
    Telerik.Reporting.Processing.SubReport subReport = (Telerik.Reporting.Processing.SubReport) sender;
 
    CustomerPortfolios custPortfolio = (CustomerPortfolios) subReport.DataObject.RawData;
    _customerPortfolio = custPortfolio.customerPortfolios;
 
    if (_customerPortfolio != null && _customerPortfolio.Count > 0)
    {
        CustomerInvoiceLogs customerInvoiceLogs = new CustomerInvoiceLogs();
 
        foreach (CustomerPortfolio cp in _customerPortfolio)
        {
            customerInvoiceLogs.AddRange(DFInvoiceStats.InvoicesByCustomerIdWithoutTaxNumberRelation(cp.CustomerId, _startYear, _endYear));
        }
 
        subReport.InnerReport.DataSource = customerInvoiceLogs;
    }
}

In the NeedDataSource above I pass on the customerInvoiceLogs collection class to the subreport. Which I can use if I drag properties from the ObjectDataSource to the Design detail section of the subreport.

If I try using the same ObjectDataSource to fill in values in the crosstab control the cells stay blank (they don't contain values like the textboxes, however there is a crosstab created for every value in customerInvoiceLogs (the headers are displayed). Could anyone let me know why this is and how I can resolve this problem.
Koen L
Top achievements
Rank 1
 answered on 29 Mar 2012
0 answers
99 views
I've been asking for this for a long long time, but I thought I'd just mock up what I mean (see attached)...

Everytime I need to find the syntax for the filter to only use the parameter if there's a value, I need to google it...and that sucks :)  This checkbox could solve that...so internally it gets handld\filtered without me needing to remember the proper IsNull syntax inside those boxes.

What do you think?

sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 asked on 28 Mar 2012
1 answer
134 views

How to group table programically?

I’m using AutoGenerateColumns project  

And add code for group table but I getting  error  “.object reference not set to an instance of an object”

 

  SqlConnection cn = new SqlConnection("Data Source=PC\\SQLEXPRESS;Initial Catalog=test;Integrated Security=True");
 
     cn.Open();
 
                SqlCommand command = new SqlCommand(“ProcName”, cn);
                command.CommandType = CommandType.StoredProcedure;
 
                SqlDataAdapter sqlAdapter = new SqlDataAdapter(command);
                DataSet ds = new DataSet();
                sqlAdapter.Fill(ds);
 
                Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
                processingTable.DataSource = ds.Tables[0];
 
                Telerik.Reporting.HtmlTextBox textboxGroup;
                Telerik.Reporting.HtmlTextBox textBoxTable;
 
                this.table1.ColumnGroups.Clear();
                this.table1.Body.Columns.Clear();
                this.table1.Body.Rows.Clear();
                this.table1.ColumnHeadersPrintOnEveryPage = true;
                int i = 0;
                float widthMid = 0;
 
                if (PageSettings.Landscape)
                    widthMid = (this.PageSettings.PaperSize.Height.Value - GetAsMm( this.PageSettings.Margins.Left) - GetAsMm( this.PageSettings.Margins.Right) ) / (ds.Tables[0].Columns.Count);
                else
                    widthMid = (this.PageSettings.PaperSize.Width.Value -  GetAsMm(this.PageSettings.Margins.Left) - GetAsMm(this.PageSettings.Margins.Right) ) / (ds.Tables[0].Columns.Count);
 
                ///////////////////////////////////////////////////////////////
               
                for (int x = ds.Tables[0].Columns.Count - 1; x >= 0; x--)
                //foreach (DataColumn dc in ds.Tables[0].Columns)
                {
                    DataColumn dc = ds.Tables[0].Columns[x];
                    Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                    this.table1.ColumnGroups.Add(tableGroupColumn);
                    this.table1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Mm(widthMid)));
 
                    textboxGroup = new Telerik.Reporting.HtmlTextBox();
                    textboxGroup.Style.BorderColor.Default = Color.Black;
                    textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                    textboxGroup.Value = Equivalent.GetEquivalent(dc.ColumnName.ToString());
                    textboxGroup.Size = new SizeU(Unit.Cm(0.2), Unit.Inch(0.3));
                    textboxGroup.Style.TextAlign = HorizontalAlign.Center;
                    tableGroupColumn.ReportItem = textboxGroup;
 
                    textBoxTable = new Telerik.Reporting.HtmlTextBox();
                    textBoxTable.Style.BorderColor.Default = Color.Red;
                    textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                    textBoxTable.Value = "=Fields." + dc.ColumnName;
                    textBoxTable.Size = new SizeU(Unit.Cm(0.2), Unit.Inch(0.3));
                    textBoxTable.Style.TextAlign = HorizontalAlign.Right;
                    this.table1.Body.SetCellContent(0, i++, textBoxTable);
                    this.table1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
                }
 
              ///////////////////////////////////////////////////////////////
///grouping part
                 
              Telerik.Reporting.TableGroup group1 = new Telerik.Reporting.TableGroup();
              group1.Name = "IDGroup";
              group1.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields.ID"));
              
              Telerik.Reporting.TextBox textBox1 = new Telerik.Reporting.TextBox();
              table1.Items.Add(textBox1);
              group1.ReportItem = textBox1;
 
              table1.RowGroups.Add(group1);           
                  
              ///////////////////////////////////////////////////////////////

 

This code have error only I using a grouping part

Elian
Telerik team
 answered on 28 Mar 2012
3 answers
223 views
Hi

Is it possible in Telerik chart Reporting for generating Bar Charts for a Cross tab Report. If it is possible then pls provide me with a link or demo to understand how to implement it.

Actually we are very very dependent on Telerik Reports so its very Urgent !!!!

Thanks in Advance....
Elian
Telerik team
 answered on 28 Mar 2012
3 answers
1.0K+ views

I have read through the documentation and to my understanding it is NOT possible to pass a parameter from an .aspx page directly to the SQL statement in the data table. I need to pull the data in its entirety and use parameters on the report to “filter” out what is not needed. Is this correct?

 

My issue is I need to pass a parameter to the WHERE clause of my SQL query to pull different users by a certain type. Unfortunately, because of the way our tables are setup I must programmatically switch between two separate queries or (data tables) depending on which user type is chosen. Also, pulling everything from our database and filtering at the report level has huge impacts on our report’s performance and I would like to stay away from that if possible.  

Elian
Telerik team
 answered on 28 Mar 2012
1 answer
110 views
I have a report that is slated to contain a URL when the report is generated. This works perfect without a hitch, however, I want the URL to generated only if there is an actual need for it. I'll illustrate the what I need based on the table below:

DescriptionField            FileNameField    
Description 1                filename1.doc
Description 2                NULL
Description 3                filename2.doc
Description 4                NULL

Based on the data above, I'd like to generate a report that would have a field that allows for clicking on a link if the filenamefield is populated. If the filenamefield is null, a URL should not be generated and therefore the generated PDF should not contain it. For example, if I generate the report above, what I want to look like is below:

Description 1 (URL embedded)
Description 2
Description 3 (URL embedded)
Description 4

I would assume that this can be accomplished from codebehind.
Steve
Telerik team
 answered on 28 Mar 2012
3 answers
126 views
Hi,

I'm discovering Telerik Reporting and read the guide : http://www.telerik.com/documents/TelerikReporting-LearningGuide.pdf
I've two different projects in the same solution. One is for the reporting and the other will use that reporting tool.
So i've created a new report in my reporting project, and tested it in Preview mode. It works.

But in my other project, when i put a ReportViewer in my .aspx, i try tu drop down the property "Report" of the control in order to bind my Report. But there's no reports in there.

What could i possibly done wrong?

Thanks
Julien
Top achievements
Rank 1
 answered on 28 Mar 2012
1 answer
94 views
Hi,
I would like to limit the export possibilities. I want to prevent export to RTF. How can I achieve this?
Kind regards
Christian
Steve
Telerik team
 answered on 28 Mar 2012
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?