How to connect to a database with frxMemo

dufduf Poland
edited 5:58PM in FastReport 4.0
Please give me step by step how to connect the Memo object to the database. Thanks

Comments

  • edited 5:58PM
    duf wrote: »
    Please give me step by step how to connect the Memo object to the database. Thanks
    - First you should add a DataSet to the report,
    - Then click on memo and Designer opens an editor,
    - Click "Insert expression" and choose DataSet and its field.


    DataSet may be added in two ways: Designer data folder and Report.DataSet property.
    I know only first one: Data folder in Designer and new object TfrxADoQuery or TfrxADOTable.
    If you use Query you can write your own select statement. To verify if it is correct click on FieldAliases at Object Inspector.
    ADOQueries need ADOConnection to be set properly - but this is an area of programmers (Delphi or other), far from my knowledge :-(

    Regards
    Mick
  • dufduf Poland
    edited February 2013
    Mick.pl wrote: »
    Mick.pl wrote: »
    Please give me step by step how to connect the Memo object to the database. Thanks
    - First you should add a DataSet to the report,
    - Then click on memo and Designer opens an editor,
    - Click "Insert expression" and choose DataSet and its field.

    DataSet may be added in two ways: Designer data folder and Report.DataSet property.
    I know only first one: Data folder in Designer and new object TfrxADoQuery or TfrxADOTable.
    If you use Query you can write your own select statement. To verify if it is correct click on FieldAliases at Object Inspector.
    ADOQueries need ADOConnection to be set properly - but this is an area of programmers (Delphi or other), far from my knowledge :-(

    Regards
    Mick
    Is MasterData I have to connect to the database? Is TfrxMemoView I have to connect to the database in DataSet and DataField properties?
  • edited 5:58PM
    wrote:
    Is MasterData I have to connect to the database? Is TfrxMemoView I have to connect to the database in DataSet and DataField properties?
    Usually you connect MasterData to a DataSet if you need to print that band for each row of the DataSet.

    If your MasterData should be print only once for a certain data you get from anywhere then you don't have to connect MasterData to any DataSet. When you work with FR Designer (after double click on MaterData band) you get a dialog named "Select DataSet" and you should select "[not assigned]" and specify "Number of records" as 1. You can see that on a picture below:
    [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Regards Mick[/img]
  • dufduf Poland
    edited February 2013
    wrote:
    If you need to assign a certain Dataset field to a Memo then have a look at here - how to do it with FR Designer:

    How to extract column names from a table? In your example, you can see the name of the table (Customers) and the names of the columns (Cust No, Company etc ...). Are they manually entered and, if so, where. Is the "Expression" field to enter sql commands? Under which name hides the database examples in the Demos folder? Thank you.
  • edited 5:58PM
    wrote:
    ...
    How to extract column names from a table? In your example, you can see the name of the table (Customers) and the names of the columns (Cust No, Company etc ...). Are they manually entered and, if so, where. Is the "Expression" field to enter sql commands? Under which name hides the database examples in the Demos folder? Thank you.
    When you are in Designer just double click on a Column name you need to pass to the Memo and you'll see it in an area below Column names, then click OK.
    Designer will pass DataSet."Columnname" into your Memo box.

    Regards
    Mick
  • dufduf Poland
    edited 5:58PM
    Mick.pl wrote: »
    Mick.pl wrote: »
    ...
    How to extract column names from a table? In your example, you can see the name of the table (Customers) and the names of the columns (Cust No, Company etc ...). Are they manually entered and, if so, where. Is the "Expression" field to enter sql commands? Under which name hides the database examples in the Demos folder? Thank you.
    When you are in Designer just double click on a Column name you need to pass to the Memo and you'll see it in an area below Column names, then click OK.
    Designer will pass DataSet."Columnname" into your Memo box.

    Regards
    Mick
    But I cannot see column name to double cklick on. I can see only Data name.
  • edited 5:58PM
    wrote:
    But I cannot see column name to double cklick on. I can see only Data name.
    Place a Memo on a band - then you'll see such a screen like below. If your Memo is already on the band just double click on it.
  • dufduf Poland
    edited 5:58PM
    Mick.pl wrote: »
    Mick.pl wrote: »
    But I cannot see column name to double cklick on. I can see only Data name.
    Place a Memo on a band - then you'll see such a screen like below. If your Memo is already on the band just double click on it.
    As You can see there is no fields of Baza. Is your table "Customers" is connected to the database server?
  • edited 5:58PM
    wrote:
    As You can see there is no fields of Baza. Is your table "Customers" is connected to the database server?
    Have a look at this small film:
  • dufduf Poland
    edited February 2013
    Mick.pl wrote: »
    Mick.pl wrote: »
    As You can see there is no fields of Baza. Is your table "Customers" is connected to the database server?
    Have a look at this small film:
    I have not got these icons on the left in Data tab! Why? How to obtain them?
    For me, this panel looks like this
  • edited 5:58PM
    wrote:
    I have not got these icons on the left in Data tab! Why? How to obtain them?
    For me, this panel looks like this
    It seems that is a Delphi issue - how to compile your project and make more icons available in the toolbar.
    I've just installed BDS 2006, and will have a look at it tommorow.

    I'll let you know when I find it.
    Unless some Delphi Gurus here will solve that for you [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Regards Mick[/img]
  • gordkgordk St.Catherines On. Canada.
    edited 5:58PM
    did you add the frxADOComponents to your uses clause
  • edited 5:58PM
    gordk wrote: »
    did you add the frxADOComponents to your uses clause
    Thanks Gordk [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Hats off ! I tried to compile a standard demo project (included with Source code of FR 4): "c:\Program Files (x86)\FastReports\FastReport 4\Demos\EmbedDesigner\Project1.dpr" and I got the same problem as Duf had - no DataSet icons on the Toolbar. After adding frxADOComponents uses clause - it works fine. There are necessery icons[/img][img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Regards Mick[/img]
  • dufduf Poland
    edited 5:58PM
    If I ask to connect to MySQL in this thread it will be the right question?
  • edited 5:58PM
    duf wrote: »
    If I ask to connect to MySQL in this thread it will be the right question?
    Sure [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Use TfrxADODatabase component from the same tool palette where you have TfrxADOQuery. Place TfrxADODatabase into Data Tab and use TfrxADODatabase.DatabaseName property - you'll be able to choose provider or ODBC. Then use your TfrxADOQuery.Database property and select that DATABASE.[/img]
  • dufduf Poland
    edited 5:58PM
    Mick.pl wrote: »
    Mick.pl wrote: »
    If I ask to connect to MySQL in this thread it will be the right question?
    Sure [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Use TfrxADODatabase component from the same tool palette where you have TfrxADOQuery. Place TfrxADODatabase into Data Tab and use TfrxADODatabase.DatabaseName property - you'll be able to choose provider or ODBC. Then use your TfrxADOQuery.Database property and select that DATABASE.[/img]
    I'm some unlucky accident >. I have not got such component TfrxADODatabase in my palette in C++ Builder. I do not understand completely.
  • edited 5:58PM
    wrote:
    I'm some unlucky accident >. I have not got such component TfrxADODatabase in my palette in C++ Builder. I do not understand completely.
    TfrxADODatabase is an internal component of FastReport.
    I thought about a Designer tool palette like in a exmaple below
    dbGo tool palette contains some components similar to those of FastReport.
    But I have no idea how to use them in your report to connect to MySQL and to TfrxADOQuery [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Let's hope some help will come here from C++ or Delphi Gurus[/img]>
  • dufduf Poland
    edited February 2013
    I was able to connect to the base of the FR > but i can not see the results in the report> . In the database there are three records, and the preview shows only three empty pages of the report.
  • edited 5:58PM
    duf wrote: »
    I was able to connect to the base of the FR > but i can not see the results in the report> . In the database there are three records, and the preview shows only three empty pages of the report.
    Well that means your MasterData is properly connected to a Database.

    Have a look at the film in Post#10 of this topic - Memo and dataset.wmv.
    Start with a small test - place a TrfxMemoView on your MasterData and insert a DataSet field into it.
    After that operation Memo should look like [<myDataSet."MyField">]
    If you run report now you should see three values from your 3 rows.

    The next step will be to place your picture on MasterData as a background - or maybe you already have it.
    If so verify at design time if that TfrxPicture is Sent to back.
  • dufduf Poland
    edited 5:58PM
    Mick.pl wrote: »
    Mick.pl wrote: »
    I was able to connect to the base of the FR > but i can not see the results in the report> . In the database there are three records, and the preview shows only three empty pages of the report.
    Well that means your MasterData is properly connected to a Database.
    No, I had to put Memo on the page rather than on the MasterData. The database is connected only to Memo.
  • edited 5:58PM
    Cut off any important (secret) information from your report and connect it (some Memos) to FR Demo database (Bio, Customers, or so).
    Then upload that report here and I'll have a look at it.
  • edited 5:58PM
    I have Delphi RAD XE3 installed with FastReports 4.0
    I cant seem to find any frxADOComponents in Tool Pallette. Any idea why this is missing, or where I need to install it from? This is driving me slowly mad!
  • gordkgordk St.Catherines On. Canada.
    edited 5:58PM
    what level of fr4 basic, standard, pro data components for internal datareports come with stanard and above

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.