About Crystal Reports, Visual Basic 2010 and Mysql

Asked

Viewed 414 times

0

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

Buttons may have 5 different status (what varies is their background color), or they may not have been checked.

Imagem do Formulário

The status of each tooth is stored in a Mysql database that has 32 fields (1 for each tooth);

The most effective way I could find to store them was as follows. Since each tooth is a set of 5 buttons, each field will receive a String of the following format: "0;1;5;3;2" for example. Each number represents a different status for each of the 5 buttons.

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

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

  • Come on, first depends on what is represented, is a dental record, visual , next to a dentists use ? It is an operational report ?

  • The report will be a kind of budget, and it should contain data such as the form code, the beginning and end of processing, etc. (so far I know how it works). My biggest problem is having to represent, in the report, the teeth so that they are represented in a similar way to the image of the post.

  • "0;1;5;3;2" says how to format the "tooth" I suppose, a simple solution I see would be to create 5 formulas for each tooth and assemble the image , the rest is to replicate 31 times, but there is in the System the ready image ? It could be carried in the CR.

  • There’s no picture ready! what I want to know is if there is actually a way to use the existing controls in the CR (such as a panel or something similar, for example) and fill them in in different ways (according to the numbers representing the tooth),

  • Maybe a graph, but I would do something simple 5 little letters representing the tooth, as the data from the comic becomes visual information ?

  • bd data is loaded on buttons as in the post image. as each tooth is represented by 5 buttons, I do a database search and will result in a string, for example "0;1;5;3;2". Then I break the string separating the numbers and with a "simple" if I fill the buttons with the corresponding colors.

  • Yes, but how the image is mounted?

  • there is no image.. that’s the point. goal is to bring to the report something similar to the buttons representing the tooth

  • Okay, but how is raw filled ? Red, blue, X ...

  • is populated using a select that will return a string and with some Ifs. the string will be, for example "5;0;1;2;3". The number 1 represents the color red, 2 represents the gray, 3 represents the blue, 4 represents the x, and 5 represents the bar. If it is 0, the button will not be filled. The position of these numbers may vary is clear and each position represents a little cross button. " up;right;down;left;center".

  • I understand, I will think of a solution in CR.

  • Thank you in advance!

Show 7 more comments

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

In Edit Formula, something like

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

It is not the most "clean" solution, but the one closest to the original Form.


The other solution would be to use an "OLE Object Dynamic", is to link the Rule to an existing bitmap.

From the Crystal Reports documentation Version 11

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 file path or URL. 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 formula 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 Dynamic 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 for 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 recommend 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 cannot 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 Adjacent 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 field, add that field to the formula. Click Save and close to Return to the Format Editor. Click OK to Return to your report. Click Refresh to update the Reference link to your Static OLE Object.

-- But I didn’t test this.

  • Sorry for the delay in answering.. what I did was adopt the first solution.. was a little time consuming and impractical but resolved and the result pleased.. Thank you very much!!

  • How 32 teeth shouldn’t change so soon ...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.