NetTalk Central

Author Topic: ExportToExcel generate/compile issue  (Read 3369 times)

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
ExportToExcel generate/compile issue
« on: February 06, 2015, 04:20:22 PM »
I am upgrading an app from C9 and NT7 to C91 and Nt8.34, I have updated everything to Current versions

I am getting errors on some code that is being generated for some of my NetBrowses relating to Export to Excel.
the error is "No Matching Protype available"
this snip-it of code is from a browse with two Fields (Strings) FrL:ShippingLineID , FrL:Line  , and two buttons Delete and Update.

Code: [Select]
    If DateColumn[ColumnNumber]
      ExcelExport.SetCell(rowNumber,ColumnNumber,p_web.mformat(FrL:ShippingLineID,'@D010-B'),'d' &  DateColumn[ColumnNumber],,'DateTime')
      If 12 > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = 12.
    ElsIf TimeColumn[ColumnNumber]
      ExcelExport.SetCell(rowNumber,ColumnNumber,'1899-12-31T' & p_web.mformat(FrL:ShippingLineID,'@T04B'),'t' &  TimeColumn[ColumnNumber],,'DateTime')
      If 12 > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = 12.
    Else
      ExcelExport.SetCell(rowNumber,ColumnNumber,FrL:ShippingLineID)
      If Len(Clip(FrL:ShippingLineID)) > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = Len(Clip(FrL:ShippingLineID)).
    End
    ColumnNumber += 1
 
this first bit makes sense, but the next block of code gets generated without the field  FrL:Line (the value is missing from the mformat functions)
But I can see nothing in the templates that might be tripping it up, i have tried to change the equate and selecting a different field.
Code: [Select]
If DateColumn[ColumnNumber]
      ExcelExport.SetCell(rowNumber,ColumnNumber,p_web.mformat( ,'@D010-B'),'d' &  DateColumn[ColumnNumber],,'DateTime')
      If 12 > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = 12.
    ElsIf TimeColumn[ColumnNumber]
      ExcelExport.SetCell(rowNumber,ColumnNumber,'1899-12-31T' & p_web.mformat( ,'@T04B'),'t' &  TimeColumn[ColumnNumber],,'DateTime')
      If 12 > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = 12.
    Else
      ExcelExport.SetCell(rowNumber,ColumnNumber, )
      If Len(Clip( )) > ColumnWidth[ColumnNumber] then ColumnWidth[ColumnNumber] = Len(Clip( )).
    End

i keep looking for a tickbox in the template to simply suppress a column from the export (perhaps conditionally).
regardless I cannot see anything materially different between the two fields.
It appears i could delete the field and add it back in, but i have a number of browsers that exhibit this behavior and was hoping there is something less drastic to save me some time. Is there a known reason why, some fields will not generate correctly?

poul



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: ExportToExcel generate/compile issue
« Reply #1 on: February 08, 2015, 09:43:32 PM »
Morning Poul,

The template is looking for one of 2 settings to generate into that first parameter. Either %nDisplay (if it exists) of %nField. So I guess one of these 2 needs to be populated. (even populated with a blank string would be ok.)

(see attached pic)

Cheers
Bruce



[attachment deleted by admin]

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: ExportToExcel generate/compile issue
« Reply #2 on: February 09, 2015, 09:27:22 AM »
Thanks Bruce FWIW,

This app has been updated many times from (nt4) and I think the DIsplay field must have something in it, even though it appears empty.

as converted from a working NT7 it fails.
if i add the the same dictionary field name to the Display prompt (which was empty) it works.
if i then delete the field value it works.
if i add just a Space instead of delete/cut - it fails
when I go back to the Display prompt it appears to be empty, nothing to highlight, (But obviously not)
if a type something in then select and del/cut it will compile correctly.

poul

« Last Edit: February 09, 2015, 09:30:33 AM by Poul »