Setting Fonts of SubDocuments in Header

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
pgkammath
Posts: 26
Joined: Fri Nov 24, 2017 6:16 am

Setting Fonts of SubDocuments in Header

Post by pgkammath »

Hi,
I am tring using the code given below to set the header. I have applied the style to the Scalerichview. But its not showing the style from the Rvstyle of the Scalerichview.

When i use this code (without Header and the Subdocuments), this line,
FinalData.RichViewEdit.AddNL('IN-PATIENT RECORD',rvsheading,1) , is
FinalData.RichViewEdit.Style := RvStyle4;

FinalData.Clear;
FinalData.RichViewEdit.AddTextNL(' ',rvsNormal,0,0);
FinalData.RichViewEdit.AddNL('IN-PATIENT RECORD',rvsheading,1);
the rvsHeading is centering the data.

But from the code given below, its left aligning.


try
LastPage := ParentPage.ActivePageIndex;
FinalData.RichViewEdit.Style := RvStyle4;

FinalData.Clear;
FinalData.PageProperty.HeaderVisible := True;
FinalData.Subdocuments[srvhftNormalHeader].Clear;

if FinalData.StartEditing(srvrveHeader) then begin
FinalData.CanUpdate := False;
FinalData.Subdocuments[srvhftNormalHeader].GetRVStyle.TextStyles := RvStyle4.TextStyles;
//FinalData.SubDocuments.SetMainRVStyle(RvStyle4);
FinalData.RichViewEdit.format;

FinalData.Subdocuments[srvhftNormalHeader].AddTextNL(' ',rvsNormal,0,0);
FinalData.Subdocuments[srvhftNormalHeader].AddTextNL(' ',rvsNormal,0,0);
FinalData.Subdocuments[srvhftNormalHeader].AddNL('IN-PATIENT RECORD',rvsheading,1);
//FinalData.RichViewEdit.Format;

FinalData.Subdocuments[srvhftNormalHeader].AddTextNL('Patient Code' +#09 + ' : ' + StrSpace(HospitalNo.Text,14) + ' Patient Name' + #09 + ' : ' + PatName.Text + ' Gender : '+PatSex.Text + ' Age : '+patAge.Text + ' '+ PatAgeType.Text ,rvsNormal,0,0);
FinalData.Subdocuments[srvhftNormalHeader].AddTextNL('Admission No' +#09 + ' : ' + StrSpace(AdmitNo.Text,14) + ' Admit Date' + #09 + ' : ' + VisitDate.Text,rvsNormal,0,0);
FinalData.Subdocuments[srvhftNormalHeader].AddTextNL('Doctor' +#09#09 + ' : ' + Doctorname.Text + ' Department' + #09+ ' : ' + DeptName.Text,rvsNormal,0,0);

FinalData.Subdocuments[srvhftNormalHeader].AddBreak(2, rvbsLine, clBlack);
FinalData.Subdocuments[srvhftNormalHeader].AddNL(SubHeading,rvsheading,1);
FinalData.Format;

FinalData.CanUpdate := True;
FinalData.StartEditing(srvrveMain);
FinalData.Format;
end;
finally
end;

But could not understand what went wrong. Kindy guide.

Regards,

Post Reply