Telerik Forums
Reporting Forum
1 answer
202 views

So, I've set up a "component" for a project-level data source as described here: http://www.telerik.com/help/reporting/data-source-how-to-add-project-data-source.html

I've added the new data source to a report, and I have added a table to display the data.

When I go to the Html Preview I get an error " An error has occurred while processing Report 'Xxxx': The ConnectionString property has not been initialized."

While I was following the directions for the component, I had selected a ConnectionString and added in a SQL query with parameters and I was able to preview the data and it was looking just fine. But, now that I've added it to the report I need it in I get the above error.

 Any helps? I'm using the latest Q2 2015 tool.

Thanks,
Ken

Nasko
Telerik team
 answered on 29 Jul 2015
2 answers
161 views

Error saving the file in pdf format within the .pdf file with the message:

 An error has occurred while processing Report 'Report1':
Object with name 'Report2' already exists. Object should have unique names.

Can someone help me?

Matheus
Top achievements
Rank 1
 answered on 29 Jul 2015
1 answer
137 views

Found another issue when embedding the Report Viewer within a bootstrap site.  I found all my reports showed what looked like cell spacing in a table - see TelerikReportingBootstrapBefore.png.  This happened in Normal Viewing mode and Print Preview mode.

 All you need to do to fix it is add the following bold text before the #reportViewer1 style.  This fixes the issue for the report viewer and turns the report back to normal - see TelerikReportingBootstrapAfter.png.

<style>
        * {
             box-sizing: content-box!important;
         }

        #reportViewer1 {
            position: absolute;
            left: 5px;
            right: 5px;
            top: 5px;
            bottom: 5px;
            height: 100%;
            overflow: hidden;
            font-family: Verdana, Arial;
        }
    </style>​

Stef
Telerik team
 answered on 29 Jul 2015
1 answer
166 views

I have a ReportViewer in my WinForms application to show some data in the form of a Telerik Report. I also have some textboxes, which will update the Report when the user leaves the textbox and the text has been changed.

private void SpediControl_Leave(object sender, EventArgs e)
{
    Control ct = sender as Control;
 
    // check if text in textbox has been changed
    if (ct.Text != s) // s is the text of the textbox
    {
        // update spedi report
        InstanceReportSource repSrcSpedi = new InstanceReportSource();
        repSrcSpedi.ReportDocument = new Spedi(this);
        repViewerSpediPreview.ReportSource = repSrcSpedi;
        repViewerSpediPreview.RefreshReport();
    }
}

After​ leaving a textbox, the ReportViewer gets the focus on itself. So I'm using UpdateUI event. To test if it gets fired, I just call a MessageBox:

private void repViewerSpediPreview_UpdateUI(object sender, EventArgs e)
{
    MessageBox.Show("aaa");
}

To my surprise, the message box gets called 8 times. First, I thought the "_Leave()" event must have an error. But the Leave event is only triggered once (as expected). It's only the UpdateUI event which is triggered multiple times. Everything else is working as expected. Is this a known bug or can anyone please provide me some help?

Regards,
Danilo

Stef
Telerik team
 answered on 29 Jul 2015
4 answers
641 views
I am able to create PDF's from my Telerik report very easily, and it works great.  I want to save that report to the database, so it doesn't have to regenerate every time.  It is not saving for some reason to the database, and I know that I can do this with other PDF byte arrays in other pieces of my code.  Is something different with the Telerik Byte Array?  Both below save data with other PDF byte arrays, but not the telerik report.  What am I doing wrong?  When I debug, both have values in the byte array, reportBytes.

Example 1, VB does not work: (param1 is passed in as an integer)

            Dim reportBytes As Byte()
            Dim mimeType As String = String.Empty
            Dim ext As String = String.Empty
            Dim encoding As Encoding = encoding.Default
            reportBytes = Telerik.Reporting.Processing.ReportProcessor.Render("PDF", report, Nothing, mimeType, ext, encoding)

            asqlConnection = GF_GET_DATABASE_CONNECTION()
            Dim sql As String = "UPDATE TABLE SET PDF = @reportBytes where xxx=" & CType(param1, String)
            Dim cmd As SqlCommand = New SqlCommand(sql, asqlConnection)
            cmd.Parameters.AddWithValue("@reportBytes", reportBytes)
            Dim id As Integer = cmd.ExecuteNonQuery()

Example 2, C# does not work (param1 is passed in as an integer):
            byte[] reportBytes =ReportProcessor.Render("PDF", reportToExport, null,out mimeType, out ext, out encoding);
            Database db = DatabaseFactory.CreateDatabase("ConnectionString");
            DbCommand dbCommand = db.GetSqlStringCommand("update TABLE set PDF = @imageData where xxx=" + param1);

            db.AddInParameter(dbCommand, "@imageData", DbType.Binary, reportBytes);

            int ret = db.ExecuteNonQuery(dbCommand);
            dbCommand.Dispose();

Nasko
Telerik team
 answered on 29 Jul 2015
1 answer
186 views

I just updated my Telerik Reporting to 2015 Q2. I'm almost done fixing every obseletes properties and method but one issue remain and I can't find any proper solution to fix it. Here is my code:

Dim GridColumnElements() As Processing.ProcessingElement = GridTable.ChildElements.Find("GridColumnTextBox", True)
For i As Integer = 0 To GridColumnElements.Count - 1
     Dim ColumnRatio As Double = (GrdField.Columns(i).Width / TotalColumnPixelWidth)
     Dim ColumnWidth As Unit = TotalGridWidth.Multiply(ColumnRatio)
     Dim pe As Processing.ProcessingElement = GridColumnElements(i)
     Dim tb As Processing.TextBox = DirectCast(pe, Processing.TextBox)

 

Now I get the classic:

"Warning 'Public ReadOnly Property ChildElements As Telerik.Reporting.Processing.ProcessingElement.ElementCollection' is obsolete: 'The Telerik.Reporting.Processing.ProcessingElement.ChildElements property is now obsolete. Use Telerik.Reporting.Processing.ElementTreeHelper.GetChildElements() method instead.'

 

It doesn't seems to have any method that would suite me well in this case.. any ideas ?

Nasko
Telerik team
 answered on 29 Jul 2015
1 answer
176 views

Hi All,

 

Can we create report book with report designer only ? not using code

 

 

Nasko
Telerik team
 answered on 29 Jul 2015
4 answers
190 views

Hi All,

I'm getting a weird problem with page size/printable region with reports.

Started getting it in version Q3 2014 and upgraded to Q2 2015 and still getting it.

I designed a sample report real fast using the Band Report wizard to demonstrate the problem (see attached).

I design a report as Portrait Letter using the wizard, margins are 0 for Left and Right in the screenshot (tried .2in,...)  It appears that when the reports are rendered they are being scaled down or something.  See attached image and note the ruler at the top of the designer and the difference in the Viewer below it...

Its not occurring with any applications like Word/Excel or any other print operation.  Tried printing to Printer, XLS and PDF and its all the same.

Any ideas?  I've tried playing with margins, paper size,... In code I set the viewer to view the print layout and landscape=false and that's it.

:-s

Thanks

Stef
Telerik team
 answered on 28 Jul 2015
2 answers
131 views

Hi,

I have a telerik reporting WCF self host service to show the report with silverlight report viewer. I noticed that the WCF function fire twice when I run the report.

can anyone tell me the cause.

 

Thanks in advance

Chandan

Stef
Telerik team
 answered on 28 Jul 2015
3 answers
326 views
Hi,
I want to graphically show a simple project schedule on a report (i.e simple Gantt). I think the Range Bar graph may be suitable but can't get it to work and can't find any examples or documentation, is there anything available?
I want to list each job on the Y axis with dates on the X axis. with a Bar between start and end dates for each job.
Here is an example of the object data-source I'm using:
public class ProjectSchedule
{
    public ProjectSchedule() { }
    public string JobName { get; set; }
    public DateTime Start { get; set; }
    public DateTime End { get; set; }
    public static List<ProjectSchedule> GetSchedule()
    {
        return new List<ProjectSchedule>(){
            new ProjectSchedule(){ JobName="JOB1", Start=DateTime.Now.AddDays(5), End=DateTime.Now.AddDays(10)},
            new ProjectSchedule(){ JobName="JOB2", Start=DateTime.Now.AddDays(5), End=DateTime.Now.AddDays(15)},
            new ProjectSchedule(){ JobName="JOB3", Start=DateTime.Now.AddDays(3), End=DateTime.Now.AddDays(7)},
            new ProjectSchedule(){ JobName="JOB3", Start=DateTime.Now.AddDays(10), End=DateTime.Now.AddDays(18)}
        };
    }
}

Any help greatly appreciated.

Stef
Telerik team
 answered on 28 Jul 2015
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?