There is more you can do with this widget, see here. (And thank @hmwillett .. again) We will cover that later.
Anyway, from this thread →
I said I would show a demo. So here it is in all it’s glory.
First, I created a library to contain some demo data.
PawelPDFDemo.efxj (120.9 KB)
It has 2 functions.
One returns a DataSet with some PDF Data in Base64 format.
The other is just a little helper that retrieves the Base64 Data from the Notes Section in the function.
Yep, I just shoved the pdf in the notes. This is a demo after all lol.
Edit → That data in the notes is on the main function, and you clear it out before commit.
The structure looks like this:
Code Refs
- Assembly → Newtonsoft.Json
- Service → ICE:Lib:EfxLibraryDesigner
Function → ReturnPDFDS
//using Newtonsoft.Json;
//Signature
//Response -> output (DataSet)
//Response -> output2 (string) (not used)
Func<string> FunctionID = () =>
{
var name = this.ToString().Split('.').Last();
return name.EndsWith("Impl") ? name.Substring(0, name.Length - 4) : name;
};
Func<List<string>, string, string, DataSet> ListStringToDataSet = (list, tblName, colName) =>
{
var ds = new DataSet();
var tbl = new DataTable(tblName);
tbl.Columns.Add(colName, typeof(string));
list.ForEach(li =>
{
tbl.Rows.Add(li);
});
ds.Tables.Add(tbl);
return ds;
};
string pdfJson = ThisLib.StringDataFromNotes(LibraryID, FunctionID());
var pdfB64 = JsonConvert.DeserializeObject<List<string>>(pdfJson);
output = ListStringToDataSet(pdfB64, "PDFData", "B64Data");
Function → StringDataFromNotes
//Signature
//Input -> libraryID (string)
//Input -> functionID (string)
//Response -> output (string)
try
{
CallService<Ice.Contracts.EfxLibraryDesignerSvcContract>(efxLibDesigner =>
{
output = efxLibDesigner.GetLibrary(libraryID).EfxFunction.Where(f => f.FunctionID == functionID).First().Notes;
});
}
catch { output = String.Empty; } //Not really needed
Kinetic App
Set up a Dashboard like this
Added a DataView
Load Data Button
Load PDF1 Button (PDF 2 is the same)
row-current-set
- PDF 2 will be
Last
(we only return 2)