Trouble using Fastreport with vb.net and Mysql

Hi
First of all thank you for a great product - So far...
After testing the demo version and the standalone reportgenerator i'm very pleased with what looks like a great product.

But im having trouble with incorporating my test report in a prpoer vb.net project,
and i cant' find any relevant documentation on the correct setup.

What I have found and done so far:

> Downloaded the dataconnections addin
> Compiled the FastReport.MySQL.dll
Result: I can generate standalone reports with FastreportReportgenerator directly connected to my MYSQL server.

Moving on to Visual studio...

> Created a new windows form project
> Added FastReport.MySQL.dll to project references
> Imported Fastreport namespace in project
> Added reference to namespace in head of form1.vb: 'Imports fastreport'
> Added reference to namespace in head of form1.vb: 'Imports Mysql'
> Added code to 'initialize' FastReport.MySQL.dll in project

'FastReport.Utils.RegisteredObjects.AddConnection(typeof(MySqlDataConnection));'
The only information found on this forum is this c# code, so i tried an autotranslator to get the c# code translated to vb.net code:
'FastReport.Utils.RegisteredObjects.AddConnection(GetType(MySqlDataConnection))'
This throws an error stating that 'MysqlDataConnection' is not defined

Any clues on what im missing here?

Regards

Comments

  • edited 8:27AM
    Found the soultion to my problem. [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Changed: Imports MySql.Data.MySqlClient And on form load: Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) FastReport.Utils.RegisteredObjects.AddConnection(GetType(Data.MySqlDataConnection)) End Sub[/img]
  • edited 8:27AM
    The story continues... what I thought yesterday was the right approach seems to bee wrong [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Eager to move my testing to my production machine, I did the following. > (On a different machine than my previos success) > Installed (for the first time on this machine) the Fastreport demo application, selected to install VS components. > Made a new VB.net Winform project in VS > Added project refernces to MySql.Data and FastReport.MySQL.dll and imported their namespaces. > Added reference to namespace in head of form1.vb: 'Imports fastreport' > Added reference to namespace in head of form1.vb: 'Imports Mysql.Data.MySqlClient' In other words; The same working procedure on my test machine. To my BIG SURPRISE nothing worked. I got the following Errors in VS:[/img]
    > 'Utils' is not a member of FastReports
    > Type 'Fastreport.report' is not defined
    > Reference required to assembly 'FastReport, Version=2013.1.11.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c' containing the base class 'FastReport.Data.DataConnectionBase'. Add one to your project.

    Here is my simple basic code:
    Imports MySql.Data.MySqlClient
    Imports FastReport
    
    Public Class Form1
    
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            FastReport.Utils.RegisteredObjects.AddConnection(GetType(Data.MySqlDataConnection))
        End Sub
    
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    
            Using rapport As New FastReport.Report
                rapport.Load(AppDomain.CurrentDomain.BaseDirectory & "Reports\Test.frx")
                rapport.RegisterData(xxx)
                rapport.SetParameterValue("KundeID", 6)
                rapport.Show()
            End Using
        End Sub
    
    End Class
    


    So my question is this: How do I get Fastreport installed Correctly?

    The process setting this up is all to cumbersome and seems fragile.
    I just cant get it into production [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Can anyone from Fastreport comment on this and maybe suggest an solution?[/img]
  • edited 8:27AM
    Well - blush... found the solution...

    The reason the code didnt work on my production system was of course the lacking
    FastReport, Fastreports.Bars and FastReport.Editor references was lacking in my project.

    I couldn't find these in the available .net or anywhere to choose manually,
    so when posting my previos post i supposed that the installation of the demo application went wrong in some sort.

    I missed the obvious; it seems that only when you draw a report component from the VS toolbox onto a Form,
    all the missing references automaticly got assigned to the project and my code worked.


    So now i'm off for some serious testing.
    My tests so far managed to get a complex report with a lot of logic, with relational data from 5 tables resulting in approx 200 report pages with graphics and text generated in 3-6 secs. [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Will definitively buy Fastreporst.Net - it seems to be a gem of a reportgenerator[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> regards Regards[/img]
  • edited 8:27AM
    More trouble [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> What seemed to be the solution - is not. When running my code no data went into my report. So i went on searching for a cause: > Tried to run the report in the standalone Reportgenereator but realised that I couldnt even assing a new MYSQL connection. MYSQL wasnt a visible choice even though the Mysqldata plugin was visible and 'installed'. This was done with the latest demoinstaller. > Tried to revert and install the demo build from january. Uninstalled Fastreports and reinstalled the older one. Now i can assign a new MYSQL connection in the standalone Reportgenereator.[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> > In Visual studio when trying to run the report I get an error on the following line: 'rapport.show' 'Could not load file or assembly 'Mysql.Data, Version=6.4.4.0 ....' My installed version of the Mysql.Data is 6.5.4.0 and its this version that is added as a reference in the project. ????? Any clues, fixes?[/img]

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.