Telerik Forums
Kendo UI for jQuery Forum
3 answers
1.5K+ views

Hi, 

As an expansion on my title, Im exporting a grid with some grouping to PDF, and the results make up 2 pages, but they are both being printed on the same page, please see the attachment so I dont sound crazy.

Here follows my template, pdf config and css styling:

<script id="template-pdf-export" type="text/x-kendo-template">
  <div class="pdf-export">
    <div class="header">
      <div style="float: right">Page #: pageNum # of #: totalPages #</div>
      Version Number x.y.z
    </div>
    <div class="footer">
      Page #: pageNum # of #: totalPages #
    </div>
  </div>
</script>

 

pdf: {
  fileName: "BFO-Export.pdf",
  landscape: true,
  margin: { top: "2cm", right: "1cm", bottom: "1cm", left: "1cm" },
  paperSize: "A4",    // Required so that template and scale are used
  scale: 0.8,  // Scale down the text size when printing to PDF
  template: $("#template-pdf-export").html()
}
 
/* Basic styling for a PDF export template */
.pdf-export {
    font-family: "DejaVu Sans", "Arial", sans-serif;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}
.pdf-export .header {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    border-bottom: 1px solid #888;
    color: #888;
}
.pdf-export .footer {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    border-top: 1px solid #888;
    text-align: center;
    color: #888;
}

 

Please Advise.

Thanks,
Grant

Anton Mironov
Telerik team
 answered on 15 Jun 2020
1 answer
687 views

Hello,

I'm trying to send selected values (from grid) but the creation is coming from the scheduler ..

I saved the values in a global variable and i tried to this ..

 

THIS is the ActionMethod in the Controller :

public ActionResult Cal_Create ([DataSourceRequest]DataSourceRequest request, KommunikationViewModel kommunikation,string[] SIDMITARBEITER, string[] SIDPERSONEN, List<UserViewModel> MITARBEITER_OBJ)
        {}

 

 

Create() method from my scheduler :

.Create(create => create.Action("Cal_Create""Home").Data("pass_Einladung_Miatarbeiter_Personen"))

 

PS : i copy pasted only the create() so that i don't need to copy my whole scheduler !

 

 

This is the additional function that attached to the create() function :

 function pass_Einladung_Miatarbeiter_Personen() {
                console.log("passing the array");
                console.log(Global_Array_Grid_mitarbeiter_Selected);
                var Mitarbeiter_Grids_IDs = new Array();
                var Personen_Grids_IDs = new Array();
 
                Global_Array_Grid_mitarbeiter_Selected.forEach(function (item, index) {
                    var SID_MITARBEITER_AUS_GLOBAL = item.Sid_mitarbeiter;
                    Mitarbeiter_Grids_IDs.push(SID_MITARBEITER_AUS_GLOBAL);
                });
 
                Global_Array_Grid_person_Selected.forEach(function (item, index) {
                    var SID_Personen_AUS_GLOBAL = item.Sid_personen;
                    Personen_Grids_IDs.push(SID_Personen_AUS_GLOBAL);
                });
                var xxoop = JSON.stringify(Global_Array_Grid_mitarbeiter_Selected);
                return {
                    SIDMITARBEITER: Mitarbeiter_Grids_IDs,
                    SIDPERSONEN: Personen_Grids_IDs,
                    MITARBEITER_OBJ: xxoop}
            }

 

// so i took one value from the object and put it into an array .. and that worked like a charm .. so defining a string[] as a parameter in the create ActionMethod .. did not make any problem .. but defining a List of object (like the code snippet) or a list of Objects .. is giving always NULL ! and it's not NULL because I'm console logging this variable in almost every step .. to follow if kendo delete the values after some action .. but no .. it's there .. but not getting sent to the ActionMethod ..

Thanks in Advance ..

Aleksandar
Telerik team
 answered on 12 Jun 2020
3 answers
220 views

Here is my data source:

 

var gridDataSource = new kendo.data.DataSource({
        data: orderData,
        schema: {
            model: {
                fields: {
                    Blank: { type: "string" },
                    ERevisionsUpdated: { type: "string" },
                    TIMOrderNumber: { type: "number" },
                    TBContractNumber: { type: "string" },
                    NccOrderNumber: { type: "string" },
                    AEName: { type: "string", },
                    OrderOriginalGross: { type: "number" },
                    ClientName: { type: "string" },
                    AgencyId: { type: "string" },
                    AgencyName: { type: "string" },
                    OrigMonthlyGross: { type: "number" },
                    TIMGross: { type: "number" },
                    TIMVariance: { type: "number" },
                    TIMWhole: { type: "string" },
                    TnBGross: { type: "number" },
                    TnBVariance: { type: "number" },
                    TnBWholePercent: { type: "number" },
                    Clearance: { type: "string" },
                    StartDate: { type: "date" },
                    EndDate: { type: "date" },
                    Market: { type: "string" },
                    LatestTimNote: { type: "string" },
                    TrafficSystemId: { type: "number" }
                }
            }
        },
        aggregate: [
            { field: "TnBGross", aggregate: "average" }
        ],
        pageSize: 10,
        sort: {
            field: "TIMOrderNumber",
            dir: "asc"
        }
    });

 

Here is the grid:

 

$("#ordersGrid").kendoGrid({
        selectable: true,
        allowCopy: true,
        toolbar: ["excel", "pdf", "search"],
        pdf: {
            allPages: true
        },
        resizable: true,
        //noRecords: {
        //    template: "No Records Found! Click search to query for records."
        //},
        excel: {
            allPages: true
        },
        columnMenu: false,
        columns: [
            { command: { text: "Dropped Spots", click: showDetails }, title: " ", width: "125px" },
            { command: { text: "SET", click: showDetails }, title: " ", width: "85px" },
            { field: "ERevisionsUpdated", title: "eRevision Status", width: "135px" },
            { field: "TIMOrderNumber", title: "TIM Order #", width: "114px", minResizableWidth: 100 },
            { field: "TrafficSystemId", title: "Traffic Id #", width: "100px", minResizableWidth: 80 },
            { field: "Revision", title: "Revision Info", width: "114px", minResizableWidth: 80 },
            { field: "TBContractNumber", title: "TB Contract #", width: "121px" },
            { field: "NccOrderNumber", title: "NCC Order #", width: "114px" },
            { field: "AEName", title: "AE Name", width: "150px" },
            { field: "ClientName", title: "Client Name", width: "275px", minResizableWidth: 150 },
            { field: "AgencyId", title: "Agency Id", width: "275px", minResizableWidth: 150 },
            { field: "AgencyName", title: "Agency Name", width: "275px", minResizableWidth: 150 },
            { field: "OrderOriginalGross", title: "Order Original Gross", format: "{0:c}", width: "154px" },
            { field: "OrigMonthlyGross", title: "Orig. Monthly Gross", format: "{0:c}", width: "150px" },
            { field: "TIMGross", title: "TIM Gross", format: "{0:c}", width: "120px" },
            { field: "TIMVariance", title: "TIM Variance", format: "{0:c}", width: "121px" },
            { field: "TIMWhole", title: "TIM Whole %", template: TIMWholeFunction, width: "115px" },
            { field: "TnBGross", title: "T&B Gross", format: "{0:c}", width: "100px", footerTemplate: "" },
            { field: "TnBVariance", title: "T&B Variance", format: "{0:c}", width: "115px" },//, aggregates: ["average"], footerTemplate: "Average: #=average#"},
            { field: "TnBWholePercent", title: "T&B Whole %", template: '#=kendo.format("{0:p}", TnBWholePercent / 100)#', width: "121px" },
            { field: "Clearance", title: "Clearance Rate %", width: "147px" }, //template: '#=kendo.format("{0:p}", Clearance / 100)#',
            { field: "StartDate", title: "Start", template: startDateFunction, width: "90px" },
            { field: "EndDate", title: "End", template: endDateFunction, width: "90px" },
            { field: "Market", title: "Market", width: "175px" },
            { field: "LatestTimNote", title: "Latest TIM Note", width: "800px" }
            //{ field: "TrafficSystemId", hidden: true }
        ],
        filterable: {
            extra: false
        },
        sortable: true,
        groupable: false,
        pageable: {
            pageSize: 10,
            alwaysVisible: true,
            buttonCount: 5,
            refresh: false,
            pageSizes: true
        },
        change: onGridChange,
        dataSource: gridDataSource,
        rowTemplate: '<tr class=\"#=GetRowColorValue(StartDate, EndDate)#\" data-uid="#= uid #"><td role="gridcell"> <a class="k-button" href=\"#=GetDroppedSpotsLink(TIMOrderNumber, TrafficSystemId)#\" target="_blank">Dropped Spots</a> </td><td role="gridcell"> <a class="k-button" href=\"#=GetSetLink(TBContractNumber, AreaId)#\" target="_blank">SET</a> </td><td role="gridcell" class=\"\"><img src=\"#:GetERevImage(ERevisionsUpdated)#" height=20 width=20></td><td role="gridcell"> <a href=\"#=GetTimOrderLink(TIMOrderNumber)#\"  target="_blank">#:TIMOrderNumber#</a> </td><td role="gridcell"><a class="k-button" onclick="GetTrafficSystem(#=TrafficSystemId#)" target="_blank">#: TrafficSystemId #</a> </td><td role="gridcell" ><span class="\" onclick="GetRevisionInfo(#=TIMOrderNumber#)" target="_blank"><img src=\/Content\/images\/Exclamation.svg.png height=20 width=20></span></td><td role="gridcell">#: TBContractNumber #</td><td role="gridcell">#:NccOrderNumber#</td><td role="gridcell">#: AEName #</td><td role="gridcell">#: ClientName #</td><td role="gridcell">#: GetAgencyId(AgencyId) #</td><td role="gridcell">#: AgencyName #</td><td role="gridcell">#= GetOrderOriginalGross(OrderOriginalGross) #</td><td role="gridcell">#: GetOriginalMonthlyGross(OrigMonthlyGross) #</td><td role="gridcell">#: GetTIMGross(TIMGross) #</td><td role="gridcell">#: GetTIMVariance(TIMVariance) #</td><td role="gridcell" class=\"#=GetTimWholeColorValue(TIMWhole)#\" >#: GetTIMWhole(TIMWhole) #</td><td role="gridcell">#: GetTnBGross(TnBGross) #</td><td role="gridcell">#: GetTnBVariance(TnBVariance) #</td><td role="gridcell" class=\"#=GetTnBWholeColorValue(TnBWholePercent)#\">#: GetTnBWholePercent(TnBWholePercent) #</td><td role="gridcell">#:GetClearanceValue(Clearance)#</td><td role="gridcell">#=startDateFunction(StartDate) #</td><td role="gridcell">#=startDateFunction(EndDate) #</td><td>#: Market #</td><td role="gridcell"><a href=\"#=GetTimNoteLink(TimSystemId, TIMOrderNumber)#\"  target="_blank">#: LatestTimNote #</a></td></tr>'
    });

 

 

The field TnBGross has footerTemplate value = "". i.e. empty string. This works fine. However if you insert anything, even a space like " ", then grid breaks. What could be going wrong here?

 

Thank You!

 

Please help me to find what is wrong in here...

Petar
Telerik team
 answered on 12 Jun 2020
2 answers
131 views

Hi,

I'm wondering if anyone could point me in the direction of an example to be able to select multiple scheduler events programatically if I have the data-uid for each event to be selected. 

Also I am looking to be able to de-select a single event programatically when multiple are selected. 

Thanks,

Francis

Aleksandar
Telerik team
 answered on 12 Jun 2020
1 answer
810 views

How to define different layout based on media queries? Autoflow to another row etc?

Preslav
Telerik team
 answered on 11 Jun 2020
8 answers
1.1K+ views

We want to implement something which is similar to the "EditForm" edit-mode in RadGrid for ASP.NET Ajax.

This looks promising: https://docs.telerik.com/kendo-ui/controls/scheduling/scheduler/how-to/editing/external-editor-form

However, we are in the situation where the grid's columns are created dynamically, based on configuration from a database.

Thus, we would have to implement the external editor form dynamically as well. Not impossible, of course, but I would rather avoid it :-)

The standard popup editor is, as far as I understand it, created dynamically, based on the columns of the grid. So, perhaps I could use the popup editor's template, but use it as an external form. Would that be possible (assuming you understand my question :-)

A follow-up question:

Once I have solved this (either by implementing it myself or re-using the popup editor), I would like to generate one external form per row in the grid.

In other words, if there are three rows in the grid, there would be three instances of external forms (stacked vertically). Is that possible? A sample for this, maybe based on this would be ideal! https://dojo.telerik.com/ITaciTAc

Thanks!

/Fredrik

Plamen
Telerik team
 answered on 11 Jun 2020
1 answer
116 views
why didn't my text show up in the thread?


Neli
Telerik team
 answered on 10 Jun 2020
1 answer
60 views
Can we have https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/custom-values/ in https://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect?_ga=2.101866886.689360971.1591642222-1109975323.1569285517


Neli
Telerik team
 answered on 10 Jun 2020
3 answers
410 views
I found the angular multiselect support allowCustom. Shall we add the support for it into jquery multiselect as well? https://docs.telerik.com/kendo-ui/api/javascript/ui/multiselect?_ga=2.101866886.689360971.1591642222-1109975323.1569285517

 

 


Neli
Telerik team
 answered on 10 Jun 2020
1 answer
76 views
allowCustom is supported in the angular version multiselect. May we have it in the jquery version as well?


Neli
Telerik team
 answered on 10 Jun 2020
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Dialog
Chat
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?