Telerik Forums
Reporting Forum
3 answers
255 views
We'd like to replace the default functionality for the Excel export button on the HTML report viewer.  We'd like to write a custom method for each report that will export the underlying data to spreadsheet in a format that is conducive to sorting, totalling, etc. via Excel.  We don't need to export the headings, totals, etc.

Can we override the default behavior? 

 
Stef
Telerik team
 answered on 15 Jul 2013
2 answers
220 views
Hello,

I'm new to Telerik Reporting. Is it possible to force parameter fields to be displayed on an new line. In my case the parameters are placed after each other (by 2) . I've 5 parameter fields and I want them to be displayed like:

ParameterField1
ParameterField2                ParameterField3
ParameterField4                ParameterField5

Please let me know how to achieve this.

Regards,
  Jos.
Gaurav
Top achievements
Rank 1
 answered on 15 Jul 2013
6 answers
612 views
Hi,

I am trying to use column groups and row groups to pivot the data programatically. Following is the code snippet I am working on
             crosstab1.RowGroups.Add(tableGrouprow);
                textboxGroup1 = new Telerik.Reporting.TextBox();

                textboxGroup1.Style.BorderColor.Default = Color.Black;

                textboxGroup1.Style.BorderStyle.Default = BorderType.Solid;

               
textboxGroup1.Value = "=Fields." + ds.Tables[0].Columns[0].ColumnName;/***giving column index on the column we want to group****/
                textboxGroup1.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));

                tableGrouprow.ReportItem = textboxGroup1;

but i am unable to do grouping.I have attached the screen shot of the table I want to pivot.I want pivot on month(column group) and drug(row group).I couldn't find any sample projects on this.can you please give some hint on this or a working sample would be more useful.

Thanks you..
Subrahmanya Kadiyala
Top achievements
Rank 1
 answered on 12 Jul 2013
3 answers
223 views
Hi

I'm trying to apply some custom date formatting.
So I have created a method to format the date (where parameter dt is the Field from the database)

public static string FormatDate(DateTime dt) 
        { 
            string newDt = ""
 
            if (dt != null
            { 
                string oid = waSessionState.Current(HttpContext.Current).oid; 
                waOrganisation org = (waOrganisation)HttpContext.Current.Cache[oid]; 
                newDt = dt.ToString(org.DateFormat); 
            } 
             
            return newDt; 
        } 

And for the expression I wrote:

=waMemberDetailsReport.Utilities.FormatDate(IsNull(Fields.[MemberDateRegistered], null)) 

If a DBNull value is returned from the database then I get the error "The expression contains undefined function call FormatDate()."

I don't understand why the error is occuring when I am using the IsNull() function.
Calvin
Top achievements
Rank 1
 answered on 11 Jul 2013
3 answers
382 views
Hi,

I need to know how can I prepare dynamic crosstab report. I used code from examples. But it's generate only header row and one data row.

private void crosstab1_ItemDataBinding(object sender, EventArgs e)
        {
           //Connections and commands
           .....
 
            //get the processing table object since we're in the context of event
            Telerik.Reporting.Processing.Table processingTable = (sender as Telerik.Reporting.Processing.Table);
            //construct the select statement based on the selected report parameters
            
            SqlDataAdapter sqlAdapter = new SqlDataAdapter(sComm);
            sqlAdapter.SelectCommand.CommandTimeout = 3600;
            //create a dataset, fill it and set it as datasource to the processing table object
            DataSet ds = new DataSet();
            sqlAdapter.Fill(ds);
            processingTable.DataSource = ds.Tables[0];
 
            //create two HtmlTextBox items (one for header and one for data) which would be added to the items collection of the table
            Telerik.Reporting.HtmlTextBox textboxGroup;
            Telerik.Reporting.HtmlTextBox textBoxTable;
 
            //we do not clear the Rows collection, since we have a details row group and need to create columns only
            this.crosstab1.ColumnGroups.Clear();
            this.crosstab1.Body.Columns.Clear();
            this.crosstab1.Body.Rows.Clear();
            int i = 0;
            this.crosstab1.ColumnHeadersPrintOnEveryPage = true;
            DataTable dt = ds.Tables[0];
 
            foreach (DataColumn dc in dt.Columns)
            {
                Telerik.Reporting.TableGroup tableGroupColumn = new Telerik.Reporting.TableGroup();
                this.crosstab1.ColumnGroups.Add(tableGroupColumn);
                this.crosstab1.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(Unit.Inch(1)));
 
                textboxGroup = new Telerik.Reporting.HtmlTextBox();
                textboxGroup.Style.BorderColor.Default = Color.Black;
                textboxGroup.Style.BorderStyle.Default = BorderType.Solid;
                textboxGroup.Value = dc.ColumnName;
                textboxGroup.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                tableGroupColumn.ReportItem = textboxGroup;
 
                textBoxTable = new Telerik.Reporting.HtmlTextBox();
                textBoxTable.Style.BorderColor.Default = Color.Black;
                textBoxTable.Style.BorderStyle.Default = BorderType.Solid;
                textBoxTable.Value = "=Fields." + dc.ColumnName;
                textBoxTable.Size = new SizeU(Unit.Inch(1.1), Unit.Inch(0.3));
                this.crosstab1.Body.SetCellContent(0, i++, textBoxTable);
                this.crosstab1.Items.AddRange(new ReportItemBase[] { textBoxTable, textboxGroup });
            }
        }
Stef
Telerik team
 answered on 11 Jul 2013
3 answers
233 views
I cannot get a consistent rendering of the content within an HtmlTextBox from the WebReportViewer to Word and Excel exports

In HTML, the outer DIV height renders too short cropping the content.
In Word, one of the lines is not visible until you zoom in even though its the same as the next line
In Excel, the row is rendered to short and the bottom content is hidden.


Grabbing the rendered HTML from the WebForm ReportViewer it renders fine in Firefox, and Chrome but only appears to render correct in Internet Explorer when the Document Mode is set to Quirks or IE7, but this does not explain the Word and Excel issues.

The HtmlTextBox is set to 11pt because the Html Content is wrapped in a <font size=2> in order to target the desired height of 8pt.
Excel is rendering the content at 11pt as the HTML tags have been stripped, but the calculated size is not taken into account.

I assume that HTML do not like decimal font-sizes other then halves.  IE 6.7pt => 6.5pt

<div style='font-size:8pt; width:713px;'>
    <FONT size=2>
        <FONT size=1>
            I (We) certify that the information on this Balance Sheet is true and correct to the best of my (our) knowledge.  I (We) have provided this information to xxxxxxxxxxx  Bank to obtain or maintain a loan.  I (We) understand that false statements made may be subject to prosecution.  The xxxxxxxxxxx Bank is authorized to verify the statements contained herin and I (We) request and authorize all individuals or businesses to release information to xxxxxxxxxxx Bank regarding our business relationships.  I (We) agree to all these conditions and terms of this application.  <BR> <BR> <BR>Signature:________________________________________________________ Date: __________<BR> <BR> <BR> <BR>Signature: ________________________________________________________Date:__________
        </FONT>
    </FONT>
</div>
 
<br/>
<hr/>
<br/>
 
<style type="text/css">
div.htmlTextBox2 { line-height:110%; height:111px; top:535px; width:713px; font-family:Arial; font-size:11pt; margin:0; padding:0; }
div.htmlTextBox2 * { line-height:110%; }
.s67 { font-size: 9.79pt; padding: 0; }
.s68 { font-size: 6.6pt; padding:0; }
</style>
<div title="" class="htmlTextBox2 s64" style="overflow: visible; border:1px solid red;">
<DIV style="MARGIN-TOP: 0px" class=html-root>
    <DIV class=s66 style='margin:0;padding:0;'>
            <FONT class=s67>
                <FONT class=s68>
                    I (We) certify that the information on this Balance Sheet is true and correct to the best of my (our) knowledge.  I (We) have provided this information to xxxxxxxxxxx Bank to obtain or
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    maintain a loan.  I (We) understand that false statements made may be subject to prosecution.  The xxxxxxxxxxx Bank is authorized to verify the statements contained herin and I
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    (We) request and authorize all individuals or businesses to release information to xxxxxxxxxxx Bank regarding our business relationships.  I (We) agree to all these conditions and
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    terms of this application.  <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    Signature:________________________________________________________ Date: __________<BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                     <BR>
                </FONT>
            </FONT>
            <FONT class=s67>
                <FONT class=s68>
                    Signature: ________________________________________________________Date:__________
                </FONT>
            </FONT>
    </DIV>
</DIV>
</DIV>



Stef
Telerik team
 answered on 11 Jul 2013
1 answer
76 views
Hi.

Is it possible to know how much of page will be used before print it? (The data is dynamic)

The ideia is to know how much of page will be used to decide if I will print in only one page like below or two pages.

customer receipt
some data printed

-------------------------
company receipt
some data printed

If customer receipt pass the size that I tought then I will use two or more pages.

Best regards

Wilton Ruffato Wonrath
Ivan Hristov
Telerik team
 answered on 11 Jul 2013
4 answers
100 views
I installed the Telerik components (TelerikControlPanelSetup_2013_2_625.exe) that I need for the project I'm working on. However, I still get, "The type or namespace name 'Telerik' could not be found (are you missing a using directive or an assembly reference?)" when trying to compile. 

The red "Telerik" in the code does not have a "resolve" context menu item, as one would expect. I do have the following in my References for the project:

Telerik.Reporting
Telerik.Reporting.OpenXmlRendering
Telerik.Reporting.Service
Telerik.Reporting.XpsRendering
Telerik.ReportViewer.WebForms
Telerik.Web.Mvc

Perhaps the version numbers are mismatched? They are:

Runtime version: v2.0.50727
Version: 7.0.13.220

These may differ from what I downloaded (presumably the latest), but when I tried to download/install the older version (referenced in our internal install list, namely TelerikControlPanelSetup_2012_2_809.exe, the install process fails. Those woes are detailed here:

http://www.telerik.com/community/forums/reporting/telerik-reporting/unable-to-install-components.aspx

So, are the Telerik components not recognized because the ones in my References are the older versions, which I do not have installed? If so, why do they not sport a warning or error icon?
Peter
Telerik team
 answered on 11 Jul 2013
7 answers
163 views
This is probably not the best place for this, but I didn't see anything more appropriate. In order to get a project I'm working on compiling again (new machine, have to reinstall and reconfigure a gazillion things), I need to install Telerik components. However, when I try to do so, it tells me it must first download an updated installer. I agree, and it runs for awhile and then crashes, telling me:


Telerik.CommonInstaller.ControlPanel has stopped working

A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.


So what can I do to install?
Stef
Telerik team
 answered on 11 Jul 2013
3 answers
85 views
Software:
Microsoft Visual Studio 2010 Professional (Ver 4.0.30319 SP1)
Telerik Reporting (6.1.12.611)
Telerik Report Viewer (6.1.12.611)
Windows 7 Professional 64-Bit (SP1)

Problem:
Opening a designer file for a Telerik Report causes an error to occur (Screenshot attached). 

Actions Taken:
I've attempted to upgrade Telerik using the "Upgrade Wizard". Once it sees all of the reports it gives me the option to upgrade to version "6.0.12.215". 

Limitations:
In one of my reports, I use the Telerik.Reporting.InstanceReportSource class. This class was implemented after the 6.0.12.215 class from what I've read and I therefore cannot roll-back the release of Telerik that I use. It is preferred that I do not change the release of Telerik that I use at all.

Additional Information:
One of my co-workers can open the report files just fine using the same .dll references that I use since they are checked into Subversion. He can also see the reports locally when running the web application. I can not see the reports on my local copy of the application, instead I get a 503 (Service is unavailable) error. Neither of us have un-committed local changes. Our code base should be the same. 

I hope I've covered everything. I hope to hear back soon, thanks!
Stef
Telerik team
 answered on 11 Jul 2013
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?