Crystal Reports: Need advice on how to avoid use of subreports -


I'm trying to write a report to hit a very large database, which uses sub-reports ... unpleasant at least tell me how can I survive in this situation:

I am starting from a table of patient trips. There may be more than one important reading in each visit (say in the widget of the widget, which is one of the many travel tables) out of which I want the minimum and maximum of each type. So to accomplish this, I visit the patient by grouping and then use the formulas to calculate the minimum / maximum and display them in the group footer. So far, so good. However, another table is the order in which all the orders for that trip are included, from which I want to choose some minimum / maximum value to display for the encounter.

To use a subreport, the skirt, I've added some formulas for the details that have been pressed, which also displays the minimum / maximum order values ​​of the group footer. The problem is that the crystal only visits the patient, that gives the order (despite being included in the outside), and what I need is all the visits or any order that may not be that of There is a list. To make matters more complicated, there is another order table which I also need to do with it (for one more procedure for medicine). any idea?

  (visitID, patName, visitDate) ------------------------------ --- --------------------------------- 1, Patient A, July-4-2009 2, Patient B, July- 25-2009 (Visit, Line, Meditation, Dosage) ----------------------------------- --- ---------------------------- 1, 1, aspirin, 200 mg 1, 2, aspirin, 500 mg 2, 1, caudine, 100 mg 2, 2, codine, 200 mg 2, 3, valerian cap, 700 mg (visit id, line, proknem, prok tyope, cost) ------------------ ----- ------------------------------------------- 1, 1, X-ray, X-ray, $ 500 1, 2, X-ray, X-ray, $ 300  
  + ----------- --------- --------------------------- | Patient a. Made Order: | Maximum aspirin dose: 500 mg. | Proc. Order: | Max Cost X-ray: $ 500 + ----------------------------------------------- | Patient B | Made Order: | ... + ---------------------------------------------- -  

You need to flatten your data set. I suggest starting with a question

In this way, some note that basically you are using the union to ask in separate detail table to join each other. Now basically you have created groups instead; When you're done, you can create multiple sections (4 sections) for the record type and record type group, by subclosing the group (.

  Select RECORDTYPE, as 'Sense' in Sense. *, --Fields for orders, --Fields for medical, --Fields visits to Vitals.VisitId for the left pulse on the processes = Visits.VisitId UNION Select All 'Order' as the RECORDTYPE, --Fields for Sense, Order *, --Fields for Medicines, --Orders.VisitId = Visits at VisitFiles.VisitId UNION join all the left orders for 'Medicines' for procedures from RECORDTYPE, --Fields, --Fields for Sense For orders, medicines *, --Fields LEFT drugs on Medications.VisitId = Visits.VisitId UNION Select all for visits from procedures. Process as' RECORDTYPE, - Fields for Weights, - Fields for Order, - LDs for File Drugs, Processes. * Processes to leave the visa on procedures Visit ID = Visit. Visit iid  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -