Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExportReportObjets.cs: VisualObjects missing elements #13

Open
ImkeF opened this issue May 1, 2022 · 10 comments
Open

ExportReportObjets.cs: VisualObjects missing elements #13

ImkeF opened this issue May 1, 2022 · 10 comments

Comments

@ImkeF
Copy link

ImkeF commented May 1, 2022

It looks as if from the non-Standard VisualObjects only the "Label" makes it into the final txt file.
All other elements (starting from row 682) don't make it into the final file.

And: For the vcObjects, the extraction path is not correct. The field "FillRule" doesn't exist any more and can simply be deleted.
However, even after that fix, those objects won't make it into the txt currently.

@ImkeF
Copy link
Author

ImkeF commented May 1, 2022

Update:
It's not an issue of making it into the file, but of being extracted. As all these fields are conditional formats now, the parsing has to be adjusted to the different cases and their attributes.

@ImkeF
Copy link
Author

ImkeF commented May 1, 2022

So the issue is with color-based attributes who depend on conditional formatting like Labes for example.
Each conditional formatting format style requires a different parsing of the measure.
The following code works, but I'm not sure if this is the best way, as I don't speak C#.

` // VisualObjects in Labels
try
{
string sc = "Label - Color - Gradient";
foreach (var o2 in configJson["singleVisual"]["objects"]["labels"].Children())
{
// labels
string tableName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["FillRule"]["Input"]["Measure"]["Expression"]["SourceRef"]["Entity"];
string objectName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["FillRule"]["Input"]["Measure"]["Property"];
string objectType = "Measure";

                VisualObjects.Add(new VisualObject {PageName = pageName, VisualId = visualId, VisualType = visualType, CustomVisualFlag = customVisualFlag, ObjectName = objectName, TableName = tableName, ObjectType = objectType, Source = sc});
            }}
            catch {}
            try
            {
            string sc = "Label - Color - FieldValue";
            foreach (var o2 in configJson["singleVisual"]["objects"]["labels"].Children())
                       {
                // labels
                string tableName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["Measure"]["Expression"]["SourceRef"]["Entity"];
                string objectName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["Measure"]["Property"];
                string objectType = "Measure";
                
                VisualObjects.Add(new VisualObject {PageName = pageName, VisualId = visualId, VisualType = visualType, CustomVisualFlag = customVisualFlag, ObjectName = objectName, TableName = tableName, ObjectType = objectType, Source = sc});
            }}
            catch{}    
            try
            {
            string sc = "Label - Color - Rules";
            foreach (var o2 in configJson["singleVisual"]["objects"]["labels"].Children())
            {
                // labels
                string tableName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["Conditional"]["Cases"][0]["Condition"]["Comparison"]["Left"]["Measure"]["Expression"]["SourceRef"]["Entity"];
                string objectName = (string)o2["properties"]["color"]["solid"]["color"]["expr"]["Conditional"]["Cases"][0]["Condition"]["Comparison"]["Left"]["Measure"]["Property"];
                string objectType = "Measure";
                
                VisualObjects.Add(new VisualObject {PageName = pageName, VisualId = visualId, VisualType = visualType, CustomVisualFlag = customVisualFlag, ObjectName = objectName, TableName = tableName, ObjectType = objectType, Source = sc});
            }}
                catch{}`

... also sorry for the messy code - I have no idea why the formatting isn't working.

@m-kovalsky
Copy link
Owner

Hi, thanks for your feedback. Try version 1.5.2

@ImkeF
Copy link
Author

ImkeF commented May 4, 2022

Hi Michael,
adjustments in the dedicated conditional formatting fit, but there is more:
All color attributes in other visual elements are now conditional as well and would have to be adjusted accordingly. If you search for "solid" you will find them like in row 839 (for "Label"), 856 (for "Category Labels") and so on.

@m-kovalsky
Copy link
Owner

Would you show an example (screenshot of the format pane) of the exact formatting to what you are referring? Thanks

@ImkeF
Copy link
Author

ImkeF commented May 22, 2022

Sure: Formatting the background here by a measure called "SecBackgroundColor", but it won't be picked up in the VisualObjects list. Sharing the test file as well (visual is on page "Decomp Tree"): https://thebiccountant-my.sharepoint.com/:u:/g/personal/imke_thebiccountant_onmicrosoft_com/EWTBXBXFk19Ik8rGU08WeCgBXtb-TGx-WBAF891f5QiRfg?e=ofE4fW

image

@m-kovalsky
Copy link
Owner

Thanks - that helped a lot!. See 1.5.3. This should not only fix the background issue but also borders & shadows (within 'Effects').

@ImkeF
Copy link
Author

ImkeF commented May 22, 2022

Thanks, yes, these occurrences are being picked up now!

If you are up to pick further measure occurrences, I could give you a list of more items that haven't been picked up yet (like colors in Data- and Category labels, legends, titles for example). Just let me know please.

Also, used measures in the smart narratives (and text visuals) are not picked up. Structure of these visual seems fairly complicated.

@m-kovalsky
Copy link
Owner

Try 1.5.4. I looked for all the formatting options and hopefully this covers them all. Smart narratives are fundamentally just text visuals so all the formatting options for text visuals (which I believe are now covered) should be covered for smart narratives as well. Let me know if you find anything else which is missing. Thanks!

@DaniilMaslyuk
Copy link

The issue seems to have returned? Please see #14 for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants