ScaleRichView Formatting Problem
Posted: Wed Feb 19, 2020 4:36 am
The following is the simple piece of code i am having trouble with.
Its simply print out line by line from a data source
Finaldata is the scalerichview component
My issue is that , the changes made to RvsHeading, RvsSubHeading etc in Rvstyle is not reflected in the report. Also, I find that the application, when used from other systems, shows the expected changes. I checked the fonts in my system, which is Ok. Is there anything which is fundmentally wrong. The application behaves wrongly on a development system and perfectly on user systems
Kindly help.
FinalData.RichViewEdit.Style := RvStyle1;
FinalData.Clear;
FinalData.ReadOnly := False;
FinalData.RichViewEdit.LoadRVF('C:\BMH-CURRENT\CCP\MASTER HEALTH CHECK-UP.rvf');
FinalData.RichViewEdit.Reformat;
if Trim(PatName.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientName>', Trim(PatName.Text));
if Trim(PatAge.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientAge>', Patgender.text + '/' + PatAge.Text);
if Trim(HospitalId.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatId>', HospitalId.Text);
if Trim(PatAdd1.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address1>', Trim(PatAdd1.Text));
if Trim(PatAdd2.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address2>', Trim(PatAdd2.Text));
if Trim(PatAdd3.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address3>', Trim(PatAdd3.Text));
if Trim(PhoneNos.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientPhone>', Copy(Trim(PhoneNos.Text),1,10));
if Trim(PhoneNos.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Mhcdate>', cMhcdate);
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.Reformat;
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
if Trim(PresComp.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL('PRESENTING COMPLAINTS ',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(PresComp.Lines.Text),rvsNormal,0,0);
end;
if Trim(SurgHist.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.AddTextNL('Surgical History',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(SurgHist.Lines.Text),rvsNormal,0,0);
end;
if Trim(MedHist.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.AddTextNL('Medications',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(MedHist.Lines.Text),rvsNormal,0,0);
end;
....
....
FinalData.RichViewEdit.Reformat;
Its simply print out line by line from a data source
Finaldata is the scalerichview component
My issue is that , the changes made to RvsHeading, RvsSubHeading etc in Rvstyle is not reflected in the report. Also, I find that the application, when used from other systems, shows the expected changes. I checked the fonts in my system, which is Ok. Is there anything which is fundmentally wrong. The application behaves wrongly on a development system and perfectly on user systems
Kindly help.
FinalData.RichViewEdit.Style := RvStyle1;
FinalData.Clear;
FinalData.ReadOnly := False;
FinalData.RichViewEdit.LoadRVF('C:\BMH-CURRENT\CCP\MASTER HEALTH CHECK-UP.rvf');
FinalData.RichViewEdit.Reformat;
if Trim(PatName.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientName>', Trim(PatName.Text));
if Trim(PatAge.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientAge>', Patgender.text + '/' + PatAge.Text);
if Trim(HospitalId.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatId>', HospitalId.Text);
if Trim(PatAdd1.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address1>', Trim(PatAdd1.Text));
if Trim(PatAdd2.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address2>', Trim(PatAdd2.Text));
if Trim(PatAdd3.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Address3>', Trim(PatAdd3.Text));
if Trim(PhoneNos.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<PatientPhone>', Copy(Trim(PhoneNos.Text),1,10));
if Trim(PhoneNos.Text) <> '' then
Search_And_Replace_RV(FinalData.RichViewEdit,'<Mhcdate>', cMhcdate);
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.Reformat;
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
if Trim(PresComp.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL('PRESENTING COMPLAINTS ',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(PresComp.Lines.Text),rvsNormal,0,0);
end;
if Trim(SurgHist.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.AddTextNL('Surgical History',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(SurgHist.Lines.Text),rvsNormal,0,0);
end;
if Trim(MedHist.Lines.Text) <> '' then begin
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.AddTextNL('Medications',rvsHeading,0,0);
FinalData.RichViewEdit.AddTextNL(Trim(MedHist.Lines.Text),rvsNormal,0,0);
end;
....
....
FinalData.RichViewEdit.Reformat;