FastReport: Is it possible to show data horizontally/programmatically? - fastreport

This is my first time using FastReport in my project. So I have trouble in creating a table. This is the table I want to show in my report.
This is the datasource I pass to the report:
<BusinessObjectDataSource Name="Employee" ReferenceName="Employee" DataType="null" Enabled="true">
<Column Name="Name" DataType="System.String"/>
<BusinessObjectDataSource Name="Detail" ReferenceName="Detail" DataType="null" Enabled="true">
<Column Name="Description" DataType="System.String"/>
<Column Name="DataA" DataType="System.Decimal"/>
<Column Name="DataB" DataType="System.Decimal"/>
</BusinessObjectDataSource>
</BusinessObjectDataSource>
And this is data sample:
[{
Name: "Employee1",
Detail: [{
Description: 'Data1',
DataA: 0,
DataB:12.25
},
{
Description: 'Data2',
DataA: 0,
DataB:2
},
{
Description: 'Data3',
DataA: 0,
DataB:7.5
}]
},
{
Name: "Employee2",
Detail: [{
Description: 'Data1',
DataA: 0,
DataB: 3
},
{
Description: 'Data2',
DataA: 0,
DataB: 2
},
{
Description: 'Data3',
DataA: 0,
DataB: 30
}]
}
]
This I try to use table but this is what I get:
Is it possible to loop the data horizontally inside the table? Or is there any programmatical method that I could try? I try to search for the solution but nothings suitable to solve my problem.

Related

PrimeVue Datatable adding a dynamic router-link to each field in a column

I am using PrimeVue version 13.15 Datatable to display my displays information from a GraphQL query with the fields ['id', 'name', 'notes']
<DataTable :value="clients" responsiveLayout="scroll">
<Column field="name" header="Name">
</Column>
<Column field="notes" header="Notes"></Column>
</DataTable>
//query
const { result } = useQuery(getClients)
const clients = computed(() => result.value?.clients ?? [])
This code works fine, but I want to link the column with "name" to another page in routes that take an id:
const routes = [
{
path: '/clients/:id',
name: 'client_profile',
component: () => import('../views/client_profile.vue')
},
]
Since the router works like this for links:
<p v-for="c in clients" :key="c.id">
<router-link :to="{ name: 'client_profile', params: { id:'c.id' }}"> {{c.name}}
</router-link>
</p>
I tried using slots as shown using hard links but it does not work. There is no information in the documentation on how to do this so far:
<DataTable :value="clients" responsiveLayout="scroll">
<Column field="name" header="Name">
<router-link :to="{ name: 'client_profile', params: { id:'slotProps.data.id' }}"> {{slotProps.data.name}}
</router-link>
</Column>
<Column field="notes" header="Notes"></Column>
</DataTable>
Ok I figured it out. You can add in a template inside the column section and add the router link like this:
<DataTable :value="clients" responsiveLayout="scroll">
<Column field="name" header="Name">
<template #body="{data}">
<router-link :to="{ name: 'client_profile', params: { id:'data.id' }}"> {{data.name}}
</router-link>
</template>
</Column>
<Column field="notes" header="Notes"></Column>
</DataTable>

Multipart, how to send file correct

I'trying to send a Multipart form data, through Flutter but the response api can't get the image file. I created a Backend just to debug my call and I got this:
My code:
Map<String, String> fields = {
"label":'-Ll7XfpsPLd_w5kz-D0m'
};
MultipartRequest request = MultipartRequest(
'POST',
Uri.parse(url),
);
request.fields.addAll(fields);
request.files.add(
MultipartFile.fromBytes(
'image',
imagem.readAsBytesSync(),
contentType: MediaType('image', 'jpeg'),
)
);
return request.send();
The server answer:
received fields:
{ label: [ '-Ll7XfpsPLd_w5kz-D0m' ],
image:
[ '\M-o\M ... A LOT OF DATA]}
Then a made a HTML page just to test:
<form method="POST" enctype="multipart/form-data" action="http://172.20.10.2:5002/upload" >
<input type="text" name="zava" value="Zava" /> <br />
<input type="file" name="image" /> <br />
<input type="submit" /> <br />
</form>
And received de server answer:
received fields:
{ zava: [ 'Zava' ] }
received files:
{ image:
[ { fieldName: 'image',
originalFilename: 'Grifo.png',
path: '/tmp/0wvX_w8W5Mw_7flqIdK0b1xX.png',
headers: [Object],
size: 114862 } ] }
What's wrong with my code? Why de Multipart does not send the file as a file?
I discovered that if you pass the optional param filename of the MultipartFile the request works correctly.
Just have to do something like this:
MultipartFile.fromBytes(
'image',
imagem.readAsBytesSync(),
contentType: MediaType('image', 'jpeg'),
filename: 'dummy.jpg'
)
I had opened a bug on flutter about the request without filename (if must be repaired or the documentation changed)...

Autoform - Update Array of Objects

I have this Schema (collection: ReleaseForms) defined:
Diseases:{
type: [Object],
optional:true
},
"Diseases.$.name": {
type: String,
optional:true
},
"Diseases.$.description": {
type: String,
optional:true
},
"Diseases.$.language": {
type: String,
optional:true
},
and in example with following content added:
ReleaseForms.update({
"_id": idNewReleaseForm},
{
$push:{
Diseases:{
name:"Blutverdünnungstherapie",
description:"xxxxxxxxxxxx",
language: "de"
}
},
});
and if i view this via Autoform and say update, it doesn't show me the existing objects like (Blutverdünnungstherapie):
But "Name" shows the existing entry of Name!
{{#autoForm collection="ReleaseForms" id="afUpdateReleaseForm" type="update" doc=selectedReleaseFormDoc}}
<fieldset>
{{> afQuickField name="Name"}}
{{> afArrayField name="Diseases"}}
</fieldset>
<button type="submit" class="btn btn-primary">Update</button>
{{/autoForm}}
What can I do that I see the existing entries of Diseases and allows me to edit them?

How to put a title for check box column in Bootstrap Table

I am using bootstrap table and have a column of check box type.
$('#table').bootstrapTable({
columns: [{
field: 'GroupId',
title: 'Group ID'
}, {
field: 'IsActive',
title: 'Active',
checkbox: true
}]
});
When i am using 'checkbox:true' then the column comes with checkbox icon including the header. Can i keep the check box icons in rows but a title for header ?
You have to add two configurations:
First disable default checkbox header in table options adding:
checkboxHeader: false
Enable checkbox title & setup custom title in column options adding:
checkbox: true,
showSelectTitle: true,
field: 'IsActive',
title: 'Active'
In your example:
$('#table').bootstrapTable({
checkboxHeader: false,
columns: [{
field: 'GroupId',
title: 'Group ID'
}, {
checkbox: true,
showSelectTitle: true,
field: 'IsActive',
title: 'Active'
}]
});
<table class="table table-bordered" id="testbedsTable"
data-pagination="true"
data-search="true"
data-checkbox-header="false">
<thead>
<tr>
<th scope="col" data-field="State" data-checkbox="true" id="tableDefaultCheck" data-show-select-title="true">Validate</th>
whereas data-checkbox-header="false" and data-show-select-title="true">Validate solved my problem
I ran a sample of this and I was able to get it to work when adapting it to a sample I already have. I doubt it is populating the checkbox properly but I wasn't concerned with trying to make that work.
http://www.codeply.com/go/h7PZLLTY0b
{
field: 'price',
title: 'Item Price',
checkbox: true
}
{
field: 'ActionField',
title: '',
sortable: false,
width: '25',
halign: "center",
formatter: "CheckBoxFormat",
checkbox: false,
clickToSelect: true,
},
function CheckBoxFormat(value, row) {
return '<input type="checkbox" class="chk" data-ID="' + row.ID + '" onclick="AddRemoveItems(this);"/>';
}

Using LinguaPlone in Plone 4, the TinyMCE editor is not showing up

I'm using LinguaPlone 4.1.3 with an instance of Plone 4.3 and upon hitting "Translate into..." and choosing one of the languages, on the following editing screen the TinyMCE editor does not show up.
I'm able to switch to Plone output HTML in the dropdown menu there on the right, and it gives me just the HTML box. However, none of the options display the TinyMCE editor. When editing normal pages (i.e. not translated content), TinyMCE works fine — it's set as the default for the site, and also the default in my personal preferences.
Any ideas to fix this or what to look for would be great! On another site on this same Plone instance, the translation functionality works fine (TinyMCE shows up as it should).
Also, in case it helps, here's the output HTML for the area where the editor would be. Thanks!
<div data-fieldname="text" data-uid="c61b5fcb98874fe3a3cf16538bcf88e3" id="archetypes-fieldname-text" class="field ArchetypesRichWidget ">
<span></span>
<label for="text" class="formQuestion">
Body Text
<span id="text_help" class="formHelp"></span>
</label>
<div class="fieldErrorBox"></div>
<div class="fieldTextFormat">
<label>Text Format</label>
<select name="text_text_format" id="text_text_format" tabindex="-1">
<option value="text/html" selected="selected">HTML</option>
<option value="text/x-web-textile">Textile</option>
<option value="text/x-plone-outputfilters-html">Plone Output Filters HTML</option>
</select>
</div>
<div>
<div>
<textarea data-mce-config="{"link_shortcuts_html": ["\n <img src=\"img/home.png\" />\n <a id=\"home\" href=\"http://169.237.124.123:8082/ChinaApple\">Home</a>\n ", "\n <img src=\"img/folder_current.png\" />\n <a id=\"currentfolder\" href=\"http://169.237.124.123:8082/ChinaApple/improving-information-use/improving-information-use-zh\">Current Folder</a>\n "], "theme": "advanced", "theme_advanced_path_location": "bottom", "entity_encoding": "raw", "plugins": "advhr,definitionlist,directionality,emotions,fullscreen,inlinepopups,insertdatetime,media,nonbreaking,noneditable,pagebreak,paste,plonebrowser,ploneinlinestyles,plonestyle,preview,print,save,searchreplace,tabfocus,table,visualchars,xhtmlxtras,contextmenu", "theme_advanced_path": false, "allow_captioned_images": true, "atd_rpc_id": "Products.TinyMCE-admin", "theme_advanced_source_editor_height": 400, "directionality": "ltr", "table_styles": "Fancy listing=listing;Invisible grid=invisible", "theme_advanced_resizing": true, "theme_advanced_buttons2": "link,unlink,anchor,tablecontrols,code,fullscreen", "theme_advanced_buttons3": "", "theme_advanced_buttons1": "style,bold,italic,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,definitionlist,outdent,indent,image", "theme_advanced_buttons4": "", "buttons": ["style", "bold", "italic", "justifyleft", "justifycenter", "justifyright", "justifyfull", "bullist", "numlist", "definitionlist", "outdent", "indent", "image", "link", "unlink", "anchor", "tablecontrols", "code", "fullscreen"], "document_url": "http://169.237.124.123:8082/ChinaApple/improving-information-use/improving-information-use-zh", "autoresize": false, "valid_inline_styles": "text-align,list-style-type,float,padding-left", "toolbar_width": 440, "language": "zh", "mode": "exact", "theme_advanced_styles": "[{ title: \"Text\", tag: \"\", className: \"-\", type: \"Text\" },{ title: \"Normal paragraph\", tag: \"p\", className: \" \", type: \"Text\" },{ title: \"Call-out\", tag: \"p\", className: \"callout\", type: \"Text\" },{ title: \"Clear floats\", tag: \"div\", className: \"visualClear\", type: \"Text\" },{ title: \"Heading\", tag: \"h2\", className: \" \", type: \"Text\" },{ title: \"Literal\", tag: \"pre\", className: \" \", type: \"Text\" },{ title: \"Pull-quote\", tag: \"blockquote\", className: \"pullquote\", type: \"Text\" },{ title: \"Subheading\", tag: \"h3\", className: \" \", type: \"Text\" },{ title: \"Selection\", tag: \"\", className: \"-\", type: \"Selection\" },{ title: \"(remove style)\", tag: \"\", className: \"\", type: \"Selection\" },{ title: \"Discreet\", tag: \"span\", className: \"discreet\", type: \"Selection\" },{ title: \"Highlight\", tag: \"span\", className: \"visualHighlight\", type: \"Selection\" },{ title: \"Tables\", tag: \"table\", className: \"-\", type: \"Tables\" },{ title: \"Plain cell\", tag: \"td\", className: \" \", type: \"Tables\" },{ title: \"Fancy listing\", tag: \"table\", className: \"listing\", type: \"Tables\" },{ title: \"Invisible grid\", tag: \"table\", className: \"invisible\", type: \"Tables\" },{ title: \"Even row\", tag: \"tr\", className: \"even\", type: \"Tables\" },{ title: \"Heading cell\", tag: \"th\", className: \" \", type: \"Tables\" },{ title: \"Odd row\", tag: \"tr\", className: \"odd\", type: \"Tables\" },{ title: \"Lists\", tag: \"ul\", className: \"-\", type: \"Lists\" },{ title: \"Lists\", tag: \"ol\", className: \"-\", type: \"Lists\" },{ title: \"Lists\", tag: \"dl\", className: \"-\", type: \"Lists\" },{ title: \"Lists\", tag: \"dl\", className: \" \", type: \"Lists\" },{ title: \"Circle\", tag: \"ul\", className: \"listTypeCircle\", type: \"Lists\" },{ title: \"Definition description\", tag: \"dd\", className: \" \", type: \"Lists\" },{ title: \"Definition term\", tag: \"dt\", className: \" \", type: \"Lists\" },{ title: \"Disc\", tag: \"ul\", className: \"listTypeDisc\", type: \"Lists\" },{ title: \"Lower Alpha\", tag: \"ol\", className: \"listTypeLowerAlpha\", type: \"Lists\" },{ title: \"Lower Roman\", tag: \"ol\", className: \"listTypeLowerRoman\", type: \"Lists\" },{ title: \"Numbers\", tag: \"ol\", className: \"listTypeDecimal\", type: \"Lists\" },{ title: \"Square\", tag: \"ul\", className: \"listTypeSquare\", type: \"Lists\" },{ title: \"Upper Alpha\", tag: \"ol\", className: \"listTypeUpperAlpha\", type: \"Lists\" },{ title: \"Upper Roman\", tag: \"ol\", className: \"listTypeUpperRoman\", type: \"Lists\" },{ title: \"Print\", tag: \"\", className: \"-\", type: \"Print\" },{ title: \"Page break (print only)\", tag: \"div\", className: \"pageBreak\", type: \"Print\" }]", "theme_advanced_toolbar_align": "left", "media_strict": false, "body_id": "content", "labels": {"label_style_ldots": "Style...", "label_addnewimage": "Add new Image", "label_browseimage": "Image Browser", "label_paragraph": "Normal paragraph", "label_print": "Print", "label_search_results": "Search results:", "label_internal_path": "you_are_here", "label_no_items": "No items in this folder", "label_browser": "Browser", "label_shortcuts": "Shortcuts", "label_addnewfile": "Add new File", "label_styles": "(remove style)", "label_tables": "Tables", "label_selection": "Selection", "label_browselink": "Link Browser", "label_text": "Text", "label_lists": "Lists", "label_no_anchors": "No anchors in this page", "label_plain_cell": "Plain cell"}, "rooted": false, "navigation_root_url": "http://169.237.124.123:8082/ChinaApple", "theme_advanced_source_editor_width": 600, "document_base_url": "http://169.237.124.123:8082/ChinaApple/improving-information-use/", "theme_advanced_resizing_use_cookie": true, "fix_list_elements": false, "inlinepopups_skin": "plonepopup", "portal_url": "http://169.237.124.123:8082/ChinaApple", "valid_elements": "i[class|dir|id|style|title],article[class|dir|id|style|title],a[accesskey|charset|class|coords|dir|href|hreflang|id|name|rel|rev|shape|style|tabindex|target|title|type],object[align|archive|class|classid|codebase|codetype|data|declare|dir|height|hspace|id|name|standby|style|tabindex|title|type|usemap|vspace|width],q[cite|class|dir|id|style|title],u[class|dir|id|style|title],bdo[class|dir|id|style|title],hgroup[class|dir|id|style|title],acronym[class|dir|id|style|title],ul[class|compact|dir|id|style|title|type],var[class|dir|id|style|title],sup[class|dir|id|style|title],colgroup[align|char|charoff|class|dir|id|span|style|title|width],embed[*],col[align|char|charoff|class|dir|id|span|style|title|width],sub[class|dir|id|style|title],nav[class|dir|id|style|title],strong[class|dir|id|style|title],map[class|dir|id|name|title],datalist[class|dir|id|style|title],address[class|dir|id|style|title],tfoot[align|char|charoff|class|dir|id|style|title],dd[class|dir|id|style|title],ruby[class|dir|id|style|title],dl[class|compact|dir|id|style|title],video[class|dir|id|style|title],#p[align|class|dir|id|style|title],dt[class|dir|id|style|title],footer[class|dir|id|style|title],body[alink|background|class|dir|id|link|style|text|title|vlink],meter[class|dir|id|style|title],area[accesskey|alt|class|coords|dir|href|id|nohref|shape|style|tabindex|target|title],dialog[class|dir|id|style|title],html[dir|id|xmlns],small[class|dir|id|style|title],cite[class|dir|id|style|title],details[class|dir|id|style|title],header[class|dir|id|style|title],aside[class|dir|id|style|title],del[cite|class|datetime|dir|id|style|title],keygen[class|dir|id|style|title],figure[class|dir|id|style|title],audio[class|dir|id|style|title],abbr[class|dir|id|style|title],canvas[class|dir|id|style|title],mark[class|dir|id|style|title],br[class|clear|id|style|title],div[align|class|dir|id|style|title],table[align|class|dir|id|style|summary|title],command[class|dir|id|style|title],caption[align|class|dir|id|style|title],source[class|dir|id|style|title],samp[class|dir|id|style|title],rt[class|dir|id|style|title],tt[class|dir|id|style|title],thead[align|char|charoff|class|dir|id|style|title],tr[align|char|charoff|class|dir|id|style|title],meta[content|dir|http-equiv|id|name|scheme],tbody[align|char|charoff|class|dir|id|style|title],td[abbr|align|axis|char|charoff|class|colspan|dir|headers|id|nowrap|rowspan|scope|style|title],output[class|dir|id|style|title],ol[class|compact|dir|id|style|title|type],th[abbr|align|axis|char|charoff|class|colspan|dir|headers|id|nowrap|rowspan|scope|style|title],blockquote[cite|class|dir|id|style|title],b[class|dir|id|style|title],span[class|dir|id|style|title],title[dir|id],time[class|dir|id|style|title],iframe[align|class|dir|frameborder|height|id|longdesc|marginheight|marginwidth|name|scrolling|src|style|title|width],dfn[class|dir|id|style|title],img[align|alt|class|dir|height|hspace|id|ismap<ismap|longdesc|name|src|style|title|usemap|vspace|width],ins[cite|class|datetime|dir|id|style|title],hr[align|class|dir|id|noshade|size|style|title|width],progress[class|dir|id|style|title],h6[align|class|dir|id|style|title],em[class|dir|id|style|title],base[href|id|target],script[charset|defer|id|language|src|type],pre[class|dir|id|style|title|width],kbd[class|dir|id|style|title],section[class|dir|id|style|title],rp[class|dir|id|style|title],li[class|dir|id|style|title|type],head[dir|id|profile],code[class|dir|id|style|title],h3[align|class|dir|id|style|title],h2[align|class|dir|id|style|title],h1[align|class|dir|id|style|title],param[id|name|type|value|valuetype],h5[align|class|dir|id|style|title],h4[align|class|dir|id|style|title],big[class|dir|id|style|title]", "content_css": "http://169.237.124.123:8082/ChinaApple/portal_tinymce/##tinymce-getstyle", "theme_advanced_resize_horizontal": false, "link_using_uids": true, "atd_ignore_strings": "Zope,Plone,TinyMCE", "contextmenu": true, "livesearch": true, "body_class": "documentContent", "thumbnail_size": ["tile", 64, 64], "skin": "plone", "anchor_selector": "h2,h3", "atd_show_types": "Bias Language,Cliches,Complex Expression,Diacritical Marks,Double Negatives,Hidden Verbs,Jargon Language,Passive voice,Phrases to Avoid,Redundant Expression", "atd_rpc_url": "http://169.237.124.123:8082/ChinaApple/##", "script_url": "http://169.237.124.123:8082/ChinaApple/tiny_mce_gzip.js", "customplugins": ["plonebrowser"], "num_of_thumb_columns": 4, "table_firstline_th": true, "image_shortcuts_html": ["\n <img src=\"img/home.png\" />\n <a id=\"home\" href=\"http://169.237.124.123:8082/ChinaApple\">Home</a>\n ", "\n <img src=\"img/folder_current.png\" />\n <a id=\"currentfolder\" href=\"http://169.237.124.123:8082/ChinaApple/improving-information-use/improving-information-use-zh\">Current Folder</a>\n "], "theme_advanced_toolbar_location": "top", "gecko_spellcheck": true}" data-pattern="plone-tinymce" class="mce_editable" id="text" name="text" rows="25" cols="40" style="visibility: hidden;"></textarea>
<div style="margin-top: -1em; display: none;" class="discreet suppressVisualEditor">
<a href="http://169.237.124.123:8082/ChinaApple/improving-information-use/improving-information-use-zh/translate_item?tinymce.suppress=text&">
Edit without visual editor
</a>
</div>
</div>
</div>
<div class="fieldUploadFile">
<span class="discreet">or upload a file (existing content will be replaced)</span>
<input type="file" name="text_file" id="text_file" size="30" originalvalue="">
</div>
</div>
The JS debug console says:
Failed to load: http://169.237.124.123:8082/ChinaApple/langs/zh.js
#eleddy solved it!! Here's her response:
Yo yo yoes! For those who don't know, Chinese (China) is a combined language so you have to go into the portal_language tool in the ZMI and check the box that says "Allow combined languages", then the other Chinese will show up. Two bottles of celebration beer later and you are Chinesing all over the place.
Simplified Chinese(zh_CN) is usually called for short Chinese(zh)
In view ##language-controlpanel
Available languages (The languages in which the site should be translatable.)
Selected 'Chinese (China)' rather than 'Chinese'.

Resources