3 Replies Latest reply: Oct 31, 2011 6:34 PM by gregg111 RSS

    InputField edit problem

      Hi

       

      I'm developing a report that requires the user to be able to override an FX Rate.  The report is split into 3 layers.  I have an extract layer that extracts the data from an Oracle database and creates the QVD files.  I have a model layer that loads all the QVD files that I need and then I have a GUI layer that displays the report.  To get the data from the model file the GUI layer just does a binary import of the model qvw.  The FX Rate table that is loaded has only 2 fields CurrencyID and USDRate.  The user needs to be able to override the USDRate so after the import of the model qvw I'm doing the following:

       

      INPUTFIELD [Override];

      CONCATENATE(REPORT_FXRATE) LOAD * INLINE [

          Override

      ];

       

      This correctly appends an input field to the FX Rate table which I'm displaying in a Table Box as below:

       

      FXRate.JPG

      The problem is when I try to enter something in the input field and move off the field the table seems to error and puts a cross over the table as below:

       

      FXRateError.jpg

      Can anyone tell me what I'm doing wrong?  My gut feeling is I'm adding the Override field to the FXRate table the wrong way because if I create a simple INLINE table with data and add the INPUTFIELD to that it works fine.

       

      Any help appreciated.


      Thanks

      Gregg.

        • Re: InputField edit problem
          Stefan Wühl

          Hi Gregg,

           

          one problem is that your above concatenate won't add any values for field Override to your data model and  inputfield needs these values set with a select or load to use as placeholder for subsequent modification.

           

          So it should look at least like this

           

          INPUTFIELD [Override];

          CONCATENATE(REPORT_FXRATE) LOAD * INLINE [

              Override

            1.0

          ];

           

          Now you have got a value, but creating a table box (or using the table viewer CTRL-T) of your table you will see that concatenation is not what you want, it just adds a row, but you don't get your new value really connected to the preexisting values for Rate and Currency, the records of your concatenated table and the original table keep being separated.

           

          You could use a cross product to add value in field Override to each existing record, maybe like this

           

          INPUTFIELD [Override];

          JOIN (REPORT_FXRATE) LOAD * INLINE [

               Override

            1.0

          ];

           

          But now the new field (and neither the other two fields) seems not to be usable as inputfield, even when I do a resident reload of the whole table.

          Here is where I am stuck also, so I think I can explain why your approach does not work, but I can't really resolve your problem at the moment.

           

          Regards,

          Stefan

            • Re: InputField edit problem
              Stefan Wühl

              Gregg,

               

              maybe this could work out:

               

              Do a second resident load of your currency table after you did the binary load, like

               

              INPUTFIELD Override;

               

              OverrideTable:

              LOAD * CurrencyID, USDRate as Override resident REPORT_FXRATE;

               

              So you get Override linked to your data model via CurrencyID, and this has also the advantage that your Override values are preset with the rates loaded from your database.

               

              Hope this helps,

              Stefan

                • InputField edit problem

                  Thanks for your help Stefan.  You put me on the right track.  I had to slightly change your suggestion above and reload from the qvd into a new table to get the input field to work as below:

                   

                  INPUTFIELD [Override USD Rate];

                   

                  Directory;

                  LOAD

                            [Currency ID]

                            ,0 as [Override USD Rate]

                  FROM

                  $(QvdDirectory)\REPORT_FXRATE.qvd (qvd);

                   

                  When I loaded from the resident table it would not recognise the input field for some reason.

                   

                  Again I really appreciate your help.  You saved me some frustrating hours.

                   

                  Regards

                  Gregg.