Documentation ¶
Index ¶
- Variables
- func BoolPointer(i bool) *bool
- func Get(data string, key string) string
- func GetArrayChildren(data string, key string) []string
- func GetBoolValue(data map[string]interface{}, key string) bool
- func GetFloatValue(data map[string]interface{}, key string) float64
- func GetIntValue(data map[string]interface{}, key string) int
- func GetObjectChildren(data string, key string) []string
- func GetStringValue(data map[string]interface{}, key string) string
- func GetValue(data map[string]interface{}, key string) interface{}
- func IsBlack(self *Color) bool
- func Merge(primary map[string]interface{}, secondary map[string]interface{}) map[string]interface{}
- func NewReport(reportDefinition map[string]interface{}, data map[string]interface{}, ...) report
- func NewReportBroError(err Error) reportBroError
- func NewTextStyle(data map[string]interface{}, keyPrefix string) textStyle
- func ReportBandPointer(i reportBand) *reportBand
- func Round(x float64) float64
- func StringPointer(i string) *string
- func Substring(str, start, end string) ([]byte, error)
- type BandDisplay
- type BandType
- type BarCodeElement
- type Border
- type BorderStyle
- type Color
- type Container
- type Context
- type DataType
- type DocElement
- type DocElementBase
- type DocElementBaseProvider
- type DocElementType
- type DocumentXLSXRenderer
- type Error
- type FPDFRB
- type Frame
- type FrameBlockElement
- type FrameElement
- type HorizontalAlignment
- type ImageElement
- type LineElement
- type Orientation
- type PageBreakElement
- type PageFormat
- type Parameter
- type ParameterType
- type RenderElementType
- type Renderer
- type SectionBand
- type SectionBandElement
- type SectionBlockElement
- type SectionElement
- type Style
- type TableBandElement
- type TableBlockElement
- type TableElement
- type TableImageElement
- type TableRow
- type TableTextElement
- type TextBlockElement
- type TextElement
- type TextLine
- type Unit
- type VerticalAlignment
Constants ¶
This section is empty.
Variables ¶
View Source
var DataTypes = [...]string{
"none",
"int",
"string",
"float",
"datetime",
"tabletextelement",
}
View Source
var EVAL_DEFAULT_NAMES = map[string]interface{}{ "True": true, "False": false, "None": nil, }
View Source
var ParameterTypes = [...]string{
"none",
"string",
"number",
"boolean",
"date",
"array",
"simple_array",
"map",
"sum",
"average",
"image",
}
Functions ¶
func BoolPointer ¶
func GetArrayChildren ¶
func GetBoolValue ¶
func GetFloatValue ¶
func GetIntValue ¶
GetIntValue retrieves int value if exists, if not returns 0
func GetObjectChildren ¶
func GetStringValue ¶
func IsBlack ¶
IsBlack returns true or false on whether or not the color is black and not transparent
func NewReportBroError ¶
func NewReportBroError(err Error) reportBroError
func NewTextStyle ¶
func ReportBandPointer ¶
func ReportBandPointer(i reportBand) *reportBand
func StringPointer ¶
Types ¶
type BandDisplay ¶
type BandDisplay int
const ( BandDisplayNever BandDisplay = 1 BandDisplayAlways BandDisplay = 2 BandDisplayNotOnFirstPage BandDisplay = 3 )
func GetBandDisplay ¶
func GetBandDisplay(bandDisplay string) BandDisplay
func (BandDisplay) String ¶
func (bandDisplay BandDisplay) String() string
type BarCodeElement ¶
type BarCodeElement struct { DocElement Content string Format string DisplayValue bool RemoveEmptyElement bool SpreadsheetHide bool SpreadsheetColumn int SpreadsheetColspan int SpreadsheetAddEmptyRow bool ImageKey *string ImageHeight float64 }
func NewBarCodeElement ¶
func NewBarCodeElement(report *report, data map[string]interface{}) *BarCodeElement
type BorderStyle ¶
type BorderStyle struct { BorderColor Color BorderWidth float64 BorderAll bool BorderLeft bool BorderTop bool BorderRight bool BorderBottom bool }
func NewBorderStyle ¶
func NewBorderStyle(data map[string]interface{}, keyPrefix string) BorderStyle
type Color ¶
type Color struct { ColorCode string `json:"color_code"` R int `json:"r"` G int `json:"g"` B int `json:"b"` Transparent bool `json:"transparent"` }
Color
func ColorPointer ¶
type Container ¶
type Container struct { ID string Report *report DocElements []DocElementBaseProvider Width float64 Height float64 AllowPageBreak bool ContainerOffsetY float64 SortedElements []DocElementBaseProvider RenderElements []DocElementBaseProvider RenderElementsCreated bool ExplicitPageBreak bool PageY float64 FirstElementOffsetY float64 UsedBandHeight float64 ManualPageBreak bool }
func NewContainer ¶
func (*Container) ClearRenderedElements ¶
func (self *Container) ClearRenderedElements()
func (*Container) GetRenderElementsBottom ¶
type Context ¶
type Context struct { Data map[string]interface{} DataStr string // For debugging Report *report PatternLocale string PatternCurrencySymbol string RootData map[string]interface{} // contains filtered or unexported fields }
func NewContext ¶
type DocElement ¶
type DocElement struct {
DocElementBase
}
func NewDocElement ¶
func NewDocElement(report *report, data map[string]interface{}) *DocElement
type DocElementBase ¶
type DocElementBase struct { Type string Report *report ID int Y float64 RenderY float64 RenderBottom float64 Bottom float64 Height float64 PrintIf string RemoveEmptyElement bool SpreadsheetHide bool SpreadsheetColumn *string SpreadsheetAddEmptyRow bool FirstRenderElement bool RenderingComplete bool Predecessors []DocElementBaseProvider Successors []DocElementBaseProvider SortOrder float64 X float64 Width float64 RenderingBottom bool Border Border BorderStyle BorderStyle BackgroundColor Color TotalHeight float64 UsedStyle *textStyle Complete bool TableElement bool BorderColor Color ZIndex int }
func NewDocElementBase ¶
func NewDocElementBase(report *report, data map[string]interface{}) *DocElementBase
func (*DocElementBase) GetOffsetY ¶
func (self *DocElementBase) GetOffsetY() float64
type DocElementBaseProvider ¶
type DocElementBaseProvider interface {
// contains filtered or unexported methods
}
type DocElementType ¶
type DocElementType int
const ( DocElementTypeText DocElementType = 1 DocElementTypeImage DocElementType = 2 DocElementTypeLine DocElementType = 3 DocElementTypePageBreak DocElementType = 4 DocElementTypeTableBand DocElementType = 5 DocElementTypeTable DocElementType = 6 DocElementTypeTableText DocElementType = 7 DocElementTypeBarCode DocElementType = 8 DocElementTypeFrame DocElementType = 9 DocElementTypeSection DocElementType = 10 DocElementTypeSectionBand DocElementType = 11 )
func GetDocElementType ¶
func GetDocElementType(docElementType string) DocElementType
func (DocElementType) String ¶
func (docElementType DocElementType) String() string
type DocumentXLSXRenderer ¶
type DocumentXLSXRenderer struct {
// contains filtered or unexported fields
}
func (*DocumentXLSXRenderer) GenerateXlsx ¶
func (self *DocumentXLSXRenderer) GenerateXlsx(filename string)
type Frame ¶
type FrameBlockElement ¶
type FrameBlockElement struct { DocElementBase RemoveEmptyElement float64 Elements []DocElementBaseProvider RenderElementType RenderElementType Complete bool }
func NewFrameBlockElement ¶
func NewFrameBlockElement(report *report, frame DocElementBaseProvider, renderY float64) *FrameBlockElement
type FrameElement ¶
type FrameElement struct { DocElement ShrinkToContentHeight bool SpreadsheetColumn int NextPageRenderingComplete bool PrevPageContentHeight float64 RenderElementType RenderElementType Container *Frame }
func NewFrameElement ¶
func NewFrameElement(report *report, data map[string]interface{}, containers *containers) *FrameElement
type HorizontalAlignment ¶
type HorizontalAlignment int
const ( HorizontalAlignmentLeft HorizontalAlignment = 1 HorizontalAlignmentCenter HorizontalAlignment = 2 HorizontalAlignmentRight HorizontalAlignment = 3 HorizontalAlignmentJustify HorizontalAlignment = 4 )
func GetHorizontalAlignment ¶
func GetHorizontalAlignment(horizontalAlignment string) HorizontalAlignment
func (HorizontalAlignment) String ¶
func (horizontalAlignment HorizontalAlignment) String() string
type ImageElement ¶
type ImageElement struct { DocElement Eval bool Source string Content string IsContent bool Image string ImageFile string ImageFilename string HorizontalAlignment HorizontalAlignment VerticalAlignment VerticalAlignment BackgroundColor Color RemoveEmptyElement bool Link string SpreadsheetHide bool SpreadsheetColumn int SpreadsheetAddEmptyRow bool ImageKey string ImageType string Image64 string ImageFP []byte ImageHeight float64 UsedStyle textStyle SpaceTop float64 SpaceBottom float64 }
func NewImageElement ¶
func NewImageElement(report *report, data map[string]interface{}) *ImageElement
type LineElement ¶
type LineElement struct { DocElement Color Color }
func NewLineElement ¶
func NewLineElement(report *report, data map[string]interface{}) *LineElement
type Orientation ¶
type Orientation int
const ( OrientationPortrait Orientation = 1 OrientationLandscape Orientation = 2 )
func (Orientation) String ¶
func (orientation Orientation) String() string
type PageBreakElement ¶
type PageBreakElement struct {
DocElementBase
}
func NewPageBreakElement ¶
func NewPageBreakElement(report *report, data map[string]interface{}) *PageBreakElement
type PageFormat ¶
type PageFormat int
const ( PageFormatA4 PageFormat = 1 PageFormatA5 PageFormat = 2 PageFormatLetter PageFormat = 3 PageFormatUserDefined PageFormat = 4 )
func (PageFormat) String ¶
func (pageFormat PageFormat) String() string
type Parameter ¶
type Parameter struct { ID int Name string Type ParameterType ArrayItemType ParameterType Eval bool Nullable bool Expression string Pattern string PatternHasCurrency bool IsInternal bool Children []interface{} Fields map[string]interface{} // contains filtered or unexported fields }
func NewParameter ¶
type ParameterType ¶
type ParameterType int
const ( ParameterTypeNone ParameterType = 0 ParameterTypeString ParameterType = 1 ParameterTypeNumber ParameterType = 2 ParameterTypeBoolean ParameterType = 3 ParameterTypeDate ParameterType = 4 ParameterTypeArray ParameterType = 5 ParameterTypeSimpleArray ParameterType = 6 ParameterTypeMap ParameterType = 7 ParameterTypeSum ParameterType = 8 ParameterTypeAverage ParameterType = 9 ParameterTypeImage ParameterType = 10 )
func (ParameterType) String ¶
func (ParameterType ParameterType) String() string
type RenderElementType ¶
type RenderElementType int
const ( RenderElementTypeNone RenderElementType = 0 RenderElementTypeComplete RenderElementType = 1 RenderElementTypeBetween RenderElementType = 2 RenderElementTypeFirst RenderElementType = 3 RenderElementTypeLast RenderElementType = 4 )
func GetRenderElementType ¶
func GetRenderElementType(renderElementType string) RenderElementType
func (RenderElementType) String ¶
func (renderElementType RenderElementType) String() string
type SectionBand ¶
type SectionBand struct { Height float64 Elements []DocElementBaseProvider }
type SectionBandElement ¶
type SectionBandElement struct { ID string Width float64 Height float64 BandType BandType RepeatHeader bool AlwaysPrintOnSamePage bool ShrinkToContentHeight bool Container Container RenderingComplete bool PrepareContainer bool RenderedBandHeight float64 }
func NewSectionBandElement ¶
func NewSectionBandElement(report *report, data map[string]interface{}, bandType BandType, container *containers) *SectionBandElement
type SectionBlockElement ¶
type SectionBlockElement struct { DocElementBase Complete bool Bands []SectionBand }
func NewSectionBlockElement ¶
func NewSectionBlockElement(report *report, renderY float64) *SectionBlockElement
type SectionElement ¶
type SectionElement struct { DocElement DataSource string Header *SectionBandElement Content *SectionBandElement PrintHeader bool DataSourceparameter *Parameter RowParameters map[string]interface{} RowCount int RowIndex int Rows map[int]interface{} }
func NewSectionElement ¶
func NewSectionElement(report *report, data map[string]interface{}, containers *containers) *SectionElement
type TableBandElement ¶
type TableBandElement struct { ID int Height float64 BandType BandType RepeatHeader bool BackgroundColor Color AlternateBackgroundColor *Color ColumnData []interface{} GroupExpression string PrintIf string BeforeGroup bool }
func NewTableBandElement ¶
func NewTableBandElement(data map[string]interface{}, bandType BandType, beforeGroup bool) *TableBandElement
type TableBlockElement ¶
type TableBlockElement struct { DocElementBase Table DocElementBaseProvider Rows []*TableRow Complete bool }
func NewTableBlockElement ¶
func NewTableBlockElement(report *report, x float64, width float64, renderY float64, table DocElementBaseProvider) *TableBlockElement
type TableElement ¶
type TableElement struct { DocElement DataSource string Columns []int PrintHeader bool ContentRows []*TableBandElement BorderWidth float64 RemoveEmptyElement bool SpreadsheetAddEmptyRow bool DataSourceparameter *Parameter RowParameters map[string]interface{} Rows []interface{} PreparedRows []*TableRow RowCount int RowIndex int PrevContentRows []*TableRow // contains filtered or unexported fields }
func NewTableElement ¶
func NewTableElement(report *report, data map[string]interface{}) *TableElement
type TableImageElement ¶
type TableImageElement struct {
ImageElement
}
func NewTableImageElement ¶
func NewTableImageElement(report *report, data map[string]interface{}) *TableImageElement
type TableRow ¶
type TableRow struct { ColumnData []DocElementBaseProvider Height float64 AlwaysPrintOnSamePage bool TableBand *TableBandElement RenderElements []DocElementBaseProvider BackgroundColor Color AlternateBackgroundColor *Color GroupExpression string PrintIfResult bool PrevRow *TableRow NextRow *TableRow }
func NewTableRow ¶
func NewTableRow(report *report, tableBand *TableBandElement, columns []int, ctx Context, prevRow *TableRow) *TableRow
type TableTextElement ¶
type TableTextElement struct {
TextElement
}
func NewTableTextElement ¶
func NewTableTextElement(report *report, data map[string]interface{}) *TableTextElement
type TextBlockElement ¶
type TextBlockElement struct { DocElementBase TextOffsetY float64 Lines []TextLine LineHeight float64 RenderElementType RenderElementType Style Style }
func NewTextBlockElement ¶
type TextElement ¶
type TextElement struct { DocElement Content string Eval bool Style textStyle Pattern string Link string CsCondition string ConditionalStyle *textStyle TextHeight float64 LineIndex int LineHeight float64 LinesCount int TextLines []TextLine SpaceTop float64 SpaceBottom float64 SpreadsheetCellFormat *int SpreadsheetCellFormatinitialized bool SpreadsheetColspan int AlwaysPrintOnSamePage bool }
func NewTextElement ¶
func NewTextElement(report *report, data map[string]interface{}) *TextElement
type VerticalAlignment ¶
type VerticalAlignment int
const ( VerticalAlignmentTop VerticalAlignment = 1 VerticalAlignmentMiddle VerticalAlignment = 2 VerticalAlignmentBottom VerticalAlignment = 3 )
func GetVerticalAlignment ¶
func GetVerticalAlignment(verticalAlignment string) VerticalAlignment
func (VerticalAlignment) String ¶
func (verticalAlignment VerticalAlignment) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.