private string DefineDesigner(TRegistro_CadContaGer RegModelo) { InlineReportSlot InlineCheque = new InlineReportSlot(); XmlDocument docXML = new XmlDocument(); if (string.IsNullOrEmpty(RegModelo.LayoutCheque)) { docXML.LoadXml(Utils.ResourcesUtils.ModeloCheque); } else { docXML.LoadXml(RegModelo.LayoutCheque); } InlineCheque.DocumentStream = docXML.InnerXml; //this.reportManager.Reports.Add(InlineCheque); InlineCheque.DesignTemplate(); docXML.LoadXml(InlineCheque.DocumentStream); return(docXML.InnerXml); }
public string DefineDesigner() { InlineReportSlot InlineNF = new InlineReportSlot(); XmlDocument docXML = new XmlDocument(); this.reportManager.Reports.Add(InlineNF); if (Cad_Report.Code_Report == null) { docXML.LoadXml(RDCPadrao.Code_Report); } else { docXML.LoadXml(System.Text.ASCIIEncoding.UTF8.GetString(Utils.Compact_Data.Descompactar(Cad_Report.Code_Report, string.Empty))); } InlineNF.DocumentStream = docXML.InnerXml; InlineNF.DesignTemplate(); docXML.LoadXml(InlineNF.DocumentStream); return(docXML.InnerXml); }
private string DefineDesigner(TRegistro_CFGImpNF RegCfgImpNf) { InlineReportSlot InlineNF = new InlineReportSlot(); XmlDocument docXML = new XmlDocument(); XmlNode no; this.reportManager.Reports.Add(InlineNF); if (RegCfgImpNf.Modelorst.Trim().Equals(string.Empty)) { Document doc = new Document(); doc.Name = "NotaFiscal"; doc.IsTemplate = true; doc.ScriptLanguage = ScriptLanguage.CSharp; Page page = new Page(); page.Name = "pageNotaFiscal"; page.Size = new PerpetuumSoft.Framework.Drawing.Vector(Convert.ToDouble(RegCfgImpNf.Larguranf), Convert.ToDouble(RegCfgImpNf.Alturanf)).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); page.TemplateSize = new PerpetuumSoft.Framework.Drawing.Vector(Convert.ToDouble(RegCfgImpNf.Larguranf), Convert.ToDouble(RegCfgImpNf.Alturanf)).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); page.PaperKind = PaperKind.Custom; page.CustomSize = new PerpetuumSoft.Framework.Drawing.Vector(Convert.ToDouble(RegCfgImpNf.Larguranf), Convert.ToDouble(RegCfgImpNf.Alturanf)).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); doc.Pages.Add(page); Picture imagemFundo = new Picture(); imagemFundo.Name = "ImagemNF"; imagemFundo.Location = new PerpetuumSoft.Framework.Drawing.Vector(0f, 0f).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); imagemFundo.Size = new PerpetuumSoft.Framework.Drawing.Vector(Convert.ToDouble(RegCfgImpNf.Larguranf), Convert.ToDouble(RegCfgImpNf.Alturanf)).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); if (RegCfgImpNf.Img != null) { imagemFundo.Image = RegCfgImpNf.Imagem; } else { System.IO.MemoryStream ms = new System.IO.MemoryStream(); ms.Write(Convert.FromBase64String(imagemBranco), 0, Convert.FromBase64String(imagemBranco).Length); imagemFundo.Image = Image.FromStream(ms); } page.Controls.Add(imagemFundo); DataBand dataBand = new DataBand(); dataBand.Name = "BandaDadosGeral"; page.Controls.Add(dataBand); dataBand.Location = new PerpetuumSoft.Framework.Drawing.Vector(0f, 0.3f).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); dataBand.Size = new PerpetuumSoft.Framework.Drawing.Vector(Convert.ToDouble(RegCfgImpNf.Larguranf), Convert.ToDouble(RegCfgImpNf.Alturanf)).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); dataBand.DataSource = "DTS"; dataBand.ColumnsCount = 1; dataBand.ColumnsGap = Unit.Convert(0.5f, Unit.Centimeter, Unit.InternalUnit); DataBand dataBandProduto = new DataBand(); dataBandProduto.Name = "BandaDadosProdutos"; dataBand.Controls.Add(dataBandProduto); dataBandProduto.Location = new PerpetuumSoft.Framework.Drawing.Vector(0f, 0.5f).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); dataBandProduto.Size = new PerpetuumSoft.Framework.Drawing.Vector(21.5f, 0.5f).ConvertUnits(Unit.Centimeter, Unit.InternalUnit); dataBandProduto.DataSource = "DTS.ItensNota"; dataBandProduto.ColumnsCount = 1; dataBandProduto.ColumnsGap = Unit.Convert(0.5f, Unit.Centimeter, Unit.InternalUnit); InlineNF.SaveReport(doc); } else { docXML.LoadXml(RegCfgImpNf.Modelorst); if (RegCfgImpNf.Img != null) { no = docXML.SelectSingleNode(String.Format("/root/Pages/Item/Controls/Item")); XmlNode noImg = no.SelectSingleNode("./Image"); if (noImg != null) { if (RegCfgImpNf.Img == null) { no.SelectSingleNode("./Image").InnerText = imagemBranco; } else { no.SelectSingleNode("./Image").InnerText = Convert.ToBase64String(RegCfgImpNf.Img); } } } InlineNF.DocumentStream = docXML.InnerXml; } InlineNF.DesignTemplate(); docXML.LoadXml(InlineNF.DocumentStream); no = docXML.SelectSingleNode(String.Format("/root/Pages/Item/Controls/Item")); XmlNode noImage = no.SelectSingleNode("./Image"); if (noImage != null) { no.SelectSingleNode("./Image").InnerText = imagemBranco; } return(docXML.InnerXml); }