a month ago
I am trying to change the field's text interpretation to HTML at runtime but it isn't working on database field. It is working for formula field. Can anyone help?
CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject fldObject = rptObj ; CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject newClone = fldObject.Clone(true); newClone.FieldFormat.StringFormat.TextFormat = CrystalDecisions.ReportAppServer.ReportDefModel.CrTextFormatEnum.crTextFormatHTMLText; //this is not working newClone.Format.HorizontalAlignment = CrAlignmentEnum.crAlignmentRight; //this is working
reportDefController.ReportObjectController.Modify(fldObject, newClone);
Request clarification before answering.
Always try it in CR Designer to see if it works, if it doesn't work in CRD it won't work in code.
As soon as you set the text to HTML it automatically left justifies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it is work in Crystal Report Designer. If i manually changed to HTML and save it. it works. Changing the same field in code is not working.
I put the horizontal align to right to test if the modify in the code is working. It proves that the right horizontal is working but the HTML format isn't..
Thanks for the update. Discussing with R&D now. They are in Shanghai so daily delays. He did note that Memo fields being a blob type field will not work, it's always been this way, but text files whould be fine. Still working on the right justification issue, it's definitely not working in CR 2020, always ignores setting in both CRD and Code... I'll update you once he confirms the issue or not...
Hi Yuen, R&D is looking at the question. they noted in CR 2010 it did not work, can you send me the report saved in 2013 with saved data? All reference material suggests this should not have worked and the only way to control the justification is to embed the justification in the HTML as a tag.
Thanks Yeun, I asked R&D to confirm again and they said it did not work. Thanks for testing again and confirming it's not working as you first indicated. I asked them for an Enhancement request to disable the justification option when converting to HTML so it stops the confusion. As suggested, use HTML Tag's to set the justification in your data, CR will always left justify.
User | Count |
---|---|
77 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.