Telerik Forums
Reporting Forum
2 answers
82 views
Dear all,

I Wish to Convert Crystal Reports to Telerik Report.
But when i start the New Report Wizard, it go direct from the welcome page to the Choose Data Source page.
Where is the Report Choice Page for me to convert report?
Anything i missing?

i Have Crystal Report XI R2 installed on my machine.
Teng Yau
Top achievements
Rank 1
 answered on 22 Mar 2012
5 answers
398 views
I'm trying to use the standalone Reportgenerator with an existing ODBC System-DSN with following connection string:
DSN=myDSN;UID=myUserid;PWD=myPwd

After inserting this connection string into the wizard, and specifying "select * from KnownTableName", following error accours:
"Unable to establish a connection to the database. Please, verify that your connection string is valid...".

This connection string works fine with WinSQL and seems to be valid (See attachment).




Elian
Telerik team
 answered on 21 Mar 2012
1 answer
144 views
I am using q2 2011 telerik reporting. when using an texbox control if I set left border of the rectangle(textbox) e.g. 4px or 4pt ... , in designer i will see all things fine (left border have more tickness) or if I set right border twice(for e.g.) I see it in correct in designer.But in the preview tab in the case of  left border ,I see that the  left and right border are more tickness and in the case of right border I have not seen any changes in right or left(no effect is seen).Is this a bug? and what is the solution?
Peter
Telerik team
 answered on 21 Mar 2012
3 answers
160 views
I'm creating an invoicing system that should be able to print multiple invoices without viewing them and with the same printer settings.

To enable this scenario i need to be able to pop up a printer dialog form and then i need to be able to use those setting to print multiple reports directly to the selected printer.

Is this possible with Telerik reporting and if so can somebody direct me to some sample code?


Peter
Telerik team
 answered on 21 Mar 2012
3 answers
519 views
I am creating a report manually, by catching "ItemDataBinding" and inserting elements.  After the report is created, I call the method below:

public void RenderPdfReport(IReportDocument report, string documentPath)
{
    ReportProcessor reportProcessor = new ReportProcessor();
    Hashtable deviceInfo = new Hashtable();
    deviceInfo["FontEmbedding"] = "None";
    RenderingResult result = reportProcessor.RenderReport("PDF", report, deviceInfo);
    if (result.DocumentBytes == null)
        return;
 
    using (FileStream fs = new FileStream(documentPath, FileMode.Create))
    {
        fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
    }
}

Here's the deal.  To minimize the size of the PDF, I used this trick
deviceInfo["FontEmbedding"] = "None";
But - text that should be bold, is now bold and italic in the PDF.
If I set FontEmbedding to the default of "Subset", the bold text in the report is correct (just bold).
Am I doing something wrong?
Has anyone else seen this?
Thank you.
Charlie
Top achievements
Rank 2
 answered on 21 Mar 2012
1 answer
259 views
I created the following class to allow me to dynamically resize the font size of report elements.  The intention of this class is to allow me to add code to the ItemDataBound event for an element, section or report to automatically size the font to the best fit.  The code works great for a TextBox element but does not work for an HtmlTextBox.  The code gets the correct size based on the content that is provided but the report is not displayed with the updated style.  I have confirmed that the code works if it is added to the ItemDataBinding event but at this point the Value of the element has not been populated.  This scenario would only be beneficial for static content and in this case it would not be necessary to dynamically resize the font.

I am pretty sure that this is a bug with the HtmlTextBox control and/or the reporting engine.  Is there a way to accomplish what I am trying to do before this can be fixed?  Also, if this is in fact a bug when might you be able to fix it?

using System;
using System.Drawing;
using System.Linq;
using Telerik.Reporting.Processing;
 
namespace ReportSample
{
    public class ReportFont
    {
        public static void AutoSizeText(DetailSection dtl, int minFontSize, int maxFontSize)
        {
            foreach (Telerik.Reporting.Processing.ProcessingElement item in dtl.ChildElements)
            {
                if (!(item is ReportItem))
                    break;
 
                ReportItem rptItem = (ReportItem)item;
                if (TextSizingSupported(rptItem))
                {
                    AutoSizeText(rptItem, minFontSize, maxFontSize);
                }
            }
        }
 
        public static void AutoSizeText(ReportItem item, int minFontSize, int maxFontSize)
        {
            AutoSizeText(item, minFontSize, maxFontSize, false);
        }
 
        public static void AutoSizeText(ReportItem item, int minFontSize, int maxFontSize, bool forceResize)
        {
            if (!forceResize && !item.Name.EndsWith("_rf"))
                return;
 
            item.Style.Font.Size = GetFontSize(item, minFontSize, maxFontSize);
        }
 
        protected static Font GetFont(Telerik.Reporting.Drawing.Font font)
        {
            return GetFont(font.Name, font.Size.Value, font.Style);
        }
 
        protected static Font GetFont(Telerik.Reporting.Drawing.Font font, float fontSize)
        {
            return GetFont(font.Name, fontSize, font.Style);
        }
 
        protected static Font GetFont(string fontName, float fontSize, FontStyle style)
        {
            FontFamily fontFamily = new FontFamily(fontName);
            return GetFont(fontFamily, fontSize, style);
        }
 
        protected static Font GetFont(FontFamily fontFamily, float fontSize, FontStyle style)
        {
            return new Font(fontFamily, fontSize, style);
        }
 
        protected static bool TextSizingSupported(ReportItem item)
        {
            if (item is HtmlTextBox || item is TextBox)
                return true;
            return false;
        }
 
        protected static Telerik.Reporting.Drawing.Unit GetFontSize(ReportItem item, int minFontSize, int maxFontSize)
        {
            Size textSize;
            Font newFont = GetFont(item.Style.Font, maxFontSize);
            Size bounds = GetBounds(item);
            string value = GetValue(item);          
             
            do
            {
                textSize = System.Windows.Forms.TextRenderer.MeasureText(value, newFont, bounds, System.Windows.Forms.TextFormatFlags.WordBreak);
                if (textSize.Height > bounds.Height && newFont.Size != minFontSize)
                    newFont = GetFont(item.Style.Font, newFont.Size - 1);
            }
            while (textSize.Height > bounds.Height && newFont.Size > minFontSize);
 
            return Telerik.Reporting.Drawing.Unit.Point(newFont.Size);
        }
 
        protected static Size GetBounds(ReportItem tb)
        {
            Size bounds = (Size)tb.Bounds.Size;
            // Adjust the bounds slightly
            bounds.Height -= 3;
            return bounds;
        }
 
        protected static string GetValue(ReportItem item)
        {
            if (item is HtmlTextBox)
                return ((HtmlTextBox)item).Value.ToString();
 
            if (item is TextBox)
                return ((TextBox)item).Value.ToString();
 
            throw new Exception("Unsupported ReportItem passed.");
        }
    }
}
Elian
Telerik team
 answered on 21 Mar 2012
4 answers
345 views
Hi,

I have added a report parameter with display member and  value member, but datasource is binded in the codebehind file. Am able to see the drop down with the display member values, but when i add a report filter using this report parameter, its throwing an error-"An error has occurred while processing Report 'ReportName':Object cannot be cast from DBNull to other types".

Only after adding the filter, am facing this error, without the filter the report displays the chart with the actual values.

I have tried adding the filter to the report and also to the report parameter available values, but none works.
please help, asap...



 
Nader
Top achievements
Rank 1
 answered on 21 Mar 2012
1 answer
212 views
Hi,

We would like to use Telerik reporting component on our aspnet server.
We have potentially 300 concurrent users of our solution.
Does Telerik can support it level of charge?
Do you have any benchmark that will help us define a strategy?
Thank you very much for your answer.
Regards

Joël
Peter
Telerik team
 answered on 21 Mar 2012
1 answer
159 views
Hi ,
    At this moment ; I use the telerik reporting's version is 5.0.11.510 , and the report's data bind the ObjectDataSource in the Report_ItemDataBinding event.

   The telerik reporting report display well by using silverlight reportviewer ; But , When I have selected the 'pdf' or 'tiff' file format to export the report , the reportviewer will throw the exception.
  
   The other file format excluded the 'pdf' or 'tiff' have exported successfully.

   Please see the attachment included the exported exception.

   How to solve this issue ?
  
   Thanks.
Peter
Telerik team
 answered on 20 Mar 2012
6 answers
917 views
I'm trying to conditionally format the text of all fields showing on my report, if the value is a specific string value. Example, if the field has a value of "No" then i would leave it alone, if it was "Yes" it would have a text font color of red. I don't want to declare this for each field, I want to write one logical statement that can check the field value and if it meets a certain criteria, then it would format the style on the textbox that contains that field reference.


Is there a way to do this through design time dialogues or programatically?
Peter
Telerik team
 answered on 19 Mar 2012
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?