Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
JPG's & Crystal Reports
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00960750
Message ID:
01171199
Views:
7
Hello Kevin,

Thank for answer and sorry for my poor English.


>FYI....CR XI now has built-in support for dynamic images.
>
>In CR XI, you can drop a picture/image control on the report body. Then right-click the picture and select Format Object on the shortcut menu. This will load the Format Editor. Go to the Picture tab, and then click the formula icon to the right of the Graphic Location option. This will load the Formula Editor, where you can specify a simple formula for the Graphic Location. The formula is simply the table name and column that stores the reference to the image (e.g. dtInvoiceHeader.ClientLogoName).

Ok ! I See ...
http://www.amline.be/Ng/UTCR21.png

My pictures are nummer with extention jpg or bmp ( ex 34.jpf 1287.bmp )
IN CRXI OLE location is includ "@PICTURE".

@PIcture is a field calculed WITH VFP COMM SERVER ( NameJpgBmp( Nummer , cLocation ) WITH This code :
 *--------------------------------------------------------------------
  *-- Retourne le nom du fichier image à placer dans OLE de CRXI.
  FUNCTION cNameJpgBmp( iPrimaryKey AS NUMBER , cDirectory AS STRING ) AS STRING

    LOCAL cName AS STRING
    LOCAL cFich AS STRING
  
    cFich = cDirectory  +  ALLTR( STR( iPrimaryKey ) )

    DO CASE
      CASE  FILE(  cFich + '.bmp' )
        cName = cFich + '.bmp'

      CASE  FILE(  cFich  + '.jpg' )
        cName = cFich + '.jpg'

      OTHER
        cName = "NOPICTURE"
    ENDCASE

    RETURN  cName

  ENDFUNC
That functions very well. I want however to transform VFP cNameJpgBmp Function INTO CRXI Function...
How can i do it ?

Thank in advance for help....


bernhart







>
>Prior to CR11, you could implement dynamic images by loading the image into a binary column. Now, I realize this is .NET code, not VFP code, I never had to do dynamic images from within VFP - maybe this can be done from within VFP, so here's the way I had to do it prior to CR11 in .NET, and hopefully this can be done in VFP.
>
>First, define a new data column in the supporting DataTable [ClientLogo]. The DataType must be base64binary, which I can set in the XML Schema Editor for the typed dataset. Alternatively, I can define the data type as a byte array (System.Byte[]) in the standard DataSet Editor.
>
>Second, after I define the binary column in the result set, I must insert the column in the report design area. Note that Crystal Reports will treat the column as a BLOB object, which I can then size and position as needed.
>
>Finally, I need to populate the image at run time when I populate the rest of the result set contents. The sample below is the code for creating a binary reader and inserting the picture image into the dataset.
>
>
>dsInvoices odsInvoices = new dsInvoices();
>string cPicFileName = "c:\\MyLogo.JPG";
>// Must create a stream and a reader
>FileStream fsStream =
>    new FileStream(cPicFileName, FileMode.Open);
>
>BinaryReader br = new BinaryReader(fsStream);
>
>-- create an instance of the new datarow
>dsInvoices.dtInvoicesRow oRow =
>   odsInvoices.dtInvoices.NewdtInvoiceRow();
>-- Set the logo, and any other columns
>oRow.ClientLogo =
>     br.ReadBytes((int)br.BaseStream.Length);
>odsInvoices.dtInvoices.AdddtInvoicesRow(oRow);
>
>
>Yes, it does mean your supporting datatable will be quite large if you have a high number of rows and/or large images. But prior to CR11, it's the only way I knew to handle it.
>
>
>Hope that helps...
>Kevin
Previous
Reply
Map
View

Click here to load this message in the networking platform