About Crystal Reports, Visual Basic 2010 and MySQL

0

I have a dental clinic project, which has a form of treatment form. This form has 160 buttons that represent the 32 teeth of a patient (each tooth is represented by a set of 5 buttons);

The buttons can have 5 different statuses (which varies by their background color), or may not have been marked.

ThestatusofeachtoothisstoredinaMysqldatabasethathas32fields(1foreachtooth);

ThemosteffectivewayIfoundtostorethemwasasfollows.Sinceeachtoothisasetof5buttons,eachfieldwillreceiveaStringofthefollowingformat:"0; 1; 5; 3; 2" for example. Each number represents a different status of each of the 5 buttons.

That's where the question comes from: How would you reproduce such teeth and their different states in a report (Crystal Reports)?

I hope you can help me. Thanks in advance ...

    
asked by anonymous 23.05.2014 / 22:10

1 answer

1

A simple solution I see is to create 5 Formulas for each tooth and format the rule, the rest is an ugly "copy and paste"

   f1
f2 f3 f4
   f5

No Edit Formula, something like

If {Comando.CAMPO} = "1" THEN
  "x"
ELSE
  " "

It's not the cleanest of the solutions, but the one closest to the original Form.

The other solution would be to use an "OLE object dynamic", to bind the Rule to an existing bitmap.

From the Crystal Reports Version 11 documentation

Making a static OLE object dynamic A dynamic static OLE object is a picture or metafile that you access in Crystal Reports by use of a URL path. Typically, you use this option when you have the path to your pictures or metafiles stored as a string field in a database (that is, you do not have the current objects stored in the database). You can also use this option when you have pictures or metafiles stored on a network share, and you know these objects change occasionally. The functionality of these dynamic static OLE objects (or dynamic graphics) is created in Crystal Reports through the use of a conditional formatting that allows you to link to static OLE objects by reference. Note: This feature is activated when you refresh your report data; therefore, you may not notice a change in the static OLE object until you click the Refresh button in Crystal Reports. When you schedule a report that contains a static static OLE object in SAP BusinessObjects Enterprise, the instances that are created contain the version of the static OLE object as it existed in your Crystal report when you scheduled it. SAP BusinessObjects Enterprise does not update the object dynamically for each instance. Reports that use an absolute or a relative path to a dynamic static OLE object are not supported in an SAP BusinessObjects Enterprise environment for this release. If you plan to publish reports that contain dynamic static OLE objects to SAP BusinessObjects Enterprise, it is recommended that you use URL links for your OLE objects. In this section: To make a static OLE object dynamic

To make a static OLE object dynamic Right-click the static OLE object that you inserted, and choose Format Graphic from the shortcut menu.

Note: You begin the process of making a static OLE object dynamic by inserting the object into your report as usual. This object becomes the default object. If Crystal Reports can not find the dynamic reference to the object, it uses the default object instead. In the Format Editor, click the Picture tab, and then click the Conditional Formula button next to the Graphic Location label. In the Formula Workshop, create the path to your static OLE object. For example, if your path is stored in a database, add that field to the formula. Click Save and close to return to Format Editor. Click OK to return to your report. Click Refresh to update the reference to your static OLE object.

- But I have not tested it.

    
26.05.2014 / 16:17