private async Task SendAndFillFupPersisant(EbMobileControl ctrl, MobileTableRow row)
        {
            List <FileWrapper> Files = ctrl.GetValue <List <FileWrapper> >();

            if (!Files.Any())
            {
                return;
            }

            try
            {
                List <ApiFileData> resp = await FormService.Instance.SendFilesAsync(Files);

                if (resp.Any())
                {
                    MobileTableColumn column = ctrl.GetMobileTableColumn();
                    List <int>        refIds = (from item in resp where item.FileRefId > 0 select item.FileRefId).ToList();
                    if (refIds.Count > 0)
                    {
                        string uploadedRefs = string.Join <int>(",", refIds);

                        if (ctrl is EbMobileAudioInput audio && audio.MultiSelect)
                        {
                            if (audio.OldValue != null)
                            {
                                uploadedRefs = audio.OldValue.ToString() + CharConstants.COMMA + uploadedRefs;
                            }
                        }
                        column.Value = uploadedRefs;
                        row.Columns.Add(column);
                    }
                }
            }
            catch (Exception ex)
            {
                EbLog.Error("error occured when sending persistant fup controls values");
                EbLog.Error(ex.Message + ", STACKTRACE:" + ex.StackTrace);
            }
        }
        public async Task <bool> Print(int rowId)
        {
            bool success = false;

            try
            {
                if (this.PrintDocs?.Count > 0)
                {
                    PdfService   PdfService = new PdfService();
                    List <Param> param      = new List <Param>();
                    if (this.RenderAsFilterDialog)
                    {
                        foreach (KeyValuePair <string, EbMobileControl> pair in this.ControlDictionary)
                        {
                            EbMobileControl ctrl = pair.Value;
                            if (ctrl is IFileUploadControl || ctrl is EbMobileDataGrid)
                            {
                                continue;
                            }
                            param.Add(new Param
                            {
                                Name  = ctrl.Name,
                                Type  = ((int)ctrl.EbDbType).ToString(),
                                Value = Convert.ToString(ctrl.GetValue())
                            });
                        }
                    }
                    else
                    {
                        param.Add(new Param
                        {
                            Name  = "id",
                            Type  = ((int)EbDbTypes.Int32).ToString(),
                            Value = rowId.ToString()
                        });
                    }

                    ReportRenderResponse r = null;

                    if (NetworkType == NetworkMode.Online)
                    {
                        if (!Utils.IsNetworkReady(this.NetworkType))
                        {
                            Utils.Alert_NoInternet();
                            return(false);
                        }
                        r = await PdfService.GetPdfOnline(this.PrintDocs[0].ObjRefId, JsonConvert.SerializeObject(param));
                    }
                    else if (NetworkType == NetworkMode.Offline)
                    {
                        r = PdfService.GetPdfOffline(this.PrintDocs[0].ObjRefId, JsonConvert.SerializeObject(param));
                    }

                    if (r?.ReportBytea != null)
                    {
                        INativeHelper helper = DependencyService.Get <INativeHelper>();
                        string        root   = App.Settings.AppDirectory;
                        string        path   = helper.NativeRoot + $"/{root}/{AppConst.SHARED_MEDIA}/{App.Settings.Sid.ToUpper()}/PDF{(DateTime.UtcNow.ToString("yyyyMMddHHmmss"))}.pdf";
                        File.WriteAllBytes(path, r.ReportBytea);

                        IAppHandler handler = DependencyService.Get <IAppHandler>();
                        string      res     = await handler.PrintPdfFile(path);

                        if (res != "success")
                        {
                            await Launcher.OpenAsync(new OpenFileRequest
                            {
                                File = new ReadOnlyFile(path)
                            });
                        }
                        success = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Utils.Toast("Error: " + ex.Message);
                EbLog.Error("Error in [EbMobileForm.Print] " + ex.Message + " " + ex.StackTrace);
            }
            return(success);
        }