TppDBRichView not showing the content

General TRichView support forum. Please post your questions here
Post Reply
GoranBru
Posts: 23
Joined: Wed Jan 22, 2020 2:26 pm

TppDBRichView not showing the content

Post by GoranBru »

Hi,
while converting some reports to use RichView component I struck on interesting problem in printing field using TppDBRichView. I have a report, which is master-detail type and uses two additional datasets, one of them is JIT with few fields. The rich text, which is actually quite basical is stored in a field of DataType dtMemo. Stock RB component TppDBRichText normally prints the data without any problems (RTF is quite basical, I could say of type RichEdit 2) while the TppDBRichView connected to same field and pipeline does not print anything at all. If I compare the components in RTM they look like this:

Code: Select all

object ppDBRichText1: TppDBRichText
        DesignLayer = ppDesignLayer4
        UserName = 'DBRichText1'
        Font.Charset = EASTEUROPE_CHARSET
        Font.Color = clBlack
        Font.Name = 'Times New Roman'
        Font.Size = 10
        Font.Style = []
        Border.mmPadding = 0
        ExportRTFAsBitmap = False
        DataField = 'RTFText'
        DataPipeline = ppJITPonudba
        ParentDataPipeline = False
        RemoveEmptyLines = False
        Stretch = True
        Transparent = True
        DataPipelineName = 'ppJITPonudba'
        mmHeight = 4763
        mmLeft = 0
        mmTop = 15610
        mmWidth = 54504
        BandType = 5
        GroupNo = 2
        LayerName = BandLayer3
        mmBottomOffset = 0
        mmOverFlowOffset = 0
        mmStopPosition = 0
        mmMinHeight = 0
      end
      object ppDBrtf: TppDBRichView
        DesignLayer = ppDesignLayer4
        UserName = 'dbRTF'
        Anchors = [atLeft, atTop, atRight]
        Caption = 'RTFText'
        DataField = 'RTFText'
        DataPipeline = ppJITPonudba
        ParentDataPipeline = False
        ShiftRelativeTo = ppDBMNoga
        ShiftWithParent = False
        Stretch = True
        Transparent = True
        DataPipelineName = 'ppJITPonudba'
        mmHeight = 12700
        mmLeft = 66411
        mmTop = 15610
        mmWidth = 109538
        BandType = 5
        GroupNo = 2
        LayerName = BandLayer3
        mmBottomOffset = 0
        mmOverFlowOffset = 0
        mmStopPosition = 0
        mmMinHeight = 0
      end
Any ideas what is going on?
ReportBuilder is 19.03, Delphi 10.2 Berlin, TRichView is 18.2 and TScaleRichView is 9.0.3.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TppDBRichView not showing the content

Post by Sergey Tkachenko »

Can you create a simple project reproducing this problem?
GoranBru
Posts: 23
Joined: Wed Jan 22, 2020 2:26 pm

Re: TppDBRichView not showing the content

Post by GoranBru »

Hi Sergey,
I guess I found the source of the problem in another area of our software. If the ppDBRRichView on the report is getting data from dome pipeline connected to TClientDataset, then the component shows the data. If connected to JIT, then nothing happens.
I tried this. I have on Datamodule a Client data set with heap of data and a JIT pipeline with defined field. The JIT component has its method OnGetFieldValue where when called, the field that requests data, gets data from global variable. While testing the global variable was filled with data from RichView from form and the JIT event OnGetFieldValue was never fired. If I put the classic ppDBRichEdit on the same report, side by side to ppDBRichView anh hook it up to same field in JIT, then event fired as soon as I scroll down to the component. And while previewing the report, RB's ppDBRichEdit showed the data, ppDBRichView was empty.
Then I created another field in ClientDataset as BLOB, at the time it was getting the data I added also the data for the new field. In the report preview component's showed data as expected.
My conclusion is that TppDBRichView has issues with JIT.
THocker
Posts: 3
Joined: Thu Apr 30, 2020 8:23 am

Re: TppDBRichView not showing the content

Post by THocker »

Same Problem here, also got a RichView using a JIT Field. The other RTF is showing without problems
Delphi 10.3, TRichView 18.3 and ReportBuilder 19.03
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: TppDBRichView not showing the content

Post by Sergey Tkachenko »

Can you create a simple example reproducing this project?

TppDBRichView does nothing special with pipelines. It simply calls DataPipeline.GetFieldAsStream(DataField, Stream), and then loads from this stream.
THocker
Posts: 3
Joined: Thu Apr 30, 2020 8:23 am

Re: TppDBRichView not showing the content

Post by THocker »

I'll try to do that, but it might take some time.
THocker
Posts: 3
Joined: Thu Apr 30, 2020 8:23 am

Re: TppDBRichView not showing the content

Post by THocker »

It wasn't a problem on the side of TRichView.
As you said, the TRichView component requests the data as stream and the default RichText asks for a string. The JIT Pipeline we had only delivered a string, so I had to add another event handler to return data as a stream.
Post Reply