Bulk change OLE Picture in all reports in Crystal Reports - Visual Studio - visual-studio-2017

I have a project that have several rpt files; all with a Logo (ICROleObject) in the header.
I want to change the logo in all the pages and I think that maybe there is a way to do it that doesn't require me doing it manually on each (100+) file.
I found that all the objects have the same name "Picture4". That's the reason I think there should be an origin file that I could sustitute or perhaps a template that is used in each file and that could be modified.
I didn't create the project and the previous developer isn't available anymore.
Any idea would be really appreciated.
Thanks in advance.
Visual Studio 2017 (15.9.17)
Crystal Reports for .NET framework
I tried looking in the assets folder to see if the image was there. I found "the image" but changing or deleting it didn't change the image in the rpt file.
I am looking for a header template or something. But I don't know if it does exist.

Related

Edit Power BI pbiviz custom visual package

I'm looking for editing a custom visual I found in the internet (its tooltip shows some data I'd like to hide).
I found out that the pbiviz file is actually a zipped folder, I extracted it and got a package.json and a folder with another .json containing the source code of the visual. The source code is minified, but I managed to make the fix there.
Now I don't know how to pack the pbiviz file again. I tried to zip the folder and rename it to .pbiviz, but Microsoft Power BI tell me it "isn't a valid custom visual" (I tried it also without editing, the error message is the same, what makes me conclude this isn't the right way to package it).
I'm trying to use Microsoft developing tools to build this package, but I still couldn't make it work.
TL;DR: I need help to edit a pbiviz source code, package it back and use on Power BI.
Instead of zipping back, you can keep the original .pbviz file, open it with a software like 7-zip and replace the files you need. This way, Power BI still recognizes it like a valid custom visual.
Important: it's necessary to replace the guid in every file for a new one, otherwise your fix will be replaced by the version on marketplace.

Can I make Visual Studio show a notification or alert when I open a particular project or solution

I would like to perform an action upon opening a particular Visual Studio 15/17/19 solution.
I need to inform anyone who is about to work on the project that there are important notes (included in the project) that they should read first. Ideally it would be a pop up so as to be very obvious.
When googling I can only find solutions that involve Visual Studio extensions but I need something that does not rely on anyone else doing anything (e.g. installing the extension) - it needs to be something dependent only on the project itself.
I'm hoping for something that I can add in the .sln or .scproj file that VS will see when it loads the solution and take action, but anything that achieves the same purpose would be good.
I'd be grateful if someone is able to let me know how I can achieve this.
You've got an extension called Solution Open Pop Up supported on many versions of Visual Studio.
In the Overview tab there is a Features section where you can see a short example of how to use it. From the extension's website:
If a file called SolutionOpenPopUp.txt and/or ReadMe.txt exists in the root folder of the solution, the contents are shown in a pop-up when the solution is open.

Can I disable precompilation for a particular folder?

I have some .cshtml templates I'm using to render to PDFs.
When I deploy to production they get precompiled and contain the text "This is a marker file generated by the precompilation tool, and should not be deleted!" Is there a way to tell ASP.NET not to precompile a particular subfolder? I thought maybe I could do this in web.config, but I can't find it.
I know this is 2 years old but recently I stumbled on the same problem, but since I needed the view for both MVC and e-mail I couldn't simply change the extension of the file.
Searching for solutions I found this documentation on aspnet_compiler and the -u options, that stands for Updatable, which keeps the original file intact after compilation.
In order to achieve the desired behavior I configured my publish profile as follow:
On Settings tab of Publish dialog expand the File Publish Options and check Precompile during publishing.
Click the Configure link after the checkbox and check Allow precompiled site to be updatable
Caution
Before jumping in this solution you should read carefully about the implications of this option. In the link I provided there is a Precompilation Decision Matrix to help on your decision.
I couldn't stop the views from being compiled, even by setting the build action to 'none' and turning on copy to output directory.
I ended up changing the extensions of my files to .prod, setting the content type as 'content', and setting them to open with the HTML editor in Visual Studio to get everything working the way I wanted.

Compressing js and css using Team Foundation Server 2010

I have been banging my head on a brick wall that seems to be easily worked around for everyone except me.
I want to setup css and js compression using a standard build on Team Foundation Server 2010. Below is what I've tried so far and failed. I am looking for a magic helping hand to guide me into setting this up the way professionals (SO is full of em) believe it should.
http://yuicompressor.codeplex.com/releases/view/46679 (dowload demo using post-build events)
This method looked promising as it did exactly as promised when you build your project in Visual Studio.
My msbuild Post-build command:
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)..\Content\StylesSheetFinal.css"
/p:JavaScriptOutputFile="$(TargetDir)..\Scripts\JavaScriptFinal.js"
However when the build is run by TFS I get a lot of errors like these:
D:\Builds\3\CKB 2010_Build_CP\Sources\CKB
2010\My.Name.Space\MSBuild\MSBuildSettings.xml (61): Failed
to save the compressed text into the output file [D:\Builds\3\CKB
2010_Build_CP\Binaries..\Content\StylesSheetFinal.css]. Please check
the path/file name and make sure the file isn't magically locked,
read-only, etc..
So clearly the problem is the syntax in the Post-build command that is wrong. But I can't figure out how to make it work for both local and TSF builds.
Update 2011-08-17
As noted by Edward Thompson, I've tried adding a backslash to the path:
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)\..\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)\..\Scripts\scripts.min.js"
And the result is this:
Failed to save the compressed text into the output file
[D:\Builds\3\CKB 2010_Build_CP\Binaries\\..\Content\styles.min.css].
Please check the path/file name and make sure the file isn't magically
locked, read-only, etc..
The problem is the difference in values with which TFS and Visual Studio run the msbuild command.
These are the steps I have taken to get proper YuiCompressor integration with Visual Studio 2010 and Team Foundation Server 2010.
In your desired project add a folder named 'MSBuild'
In this folder you should extract the files you download from the YuiCompressor project on CodePlex
Set the properties of these files like this:
Now open the MSBuildSettings.xml file and edit it according to the scripts and css files you want to have compressed. I have uploaded mine on pastebin since pasting it here caused problems with the editor.
Add the following postbuild event to your project. Note that the paths can differ for your environment.
IF "$(BuildingInsideVisualStudio)"=="" $(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)_PublishedWebsites\$(ProjectName)\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)_PublishedWebsites\$(ProjectName)\Scripts\scripts.min.js"
IF "$(BuildingInsideVisualStudio)"=="true"
$(MSBuildBinPath)\msbuild.exe
"$(ProjectDir)MSBuild\MSBuildSettings.xml"
/p:CssOutputFile="$(TargetDir)..\Content\styles.min.css"
/p:JavaScriptOutputFile="$(TargetDir)..\Scripts\scripts.min.js"
Build the project and see if the files where created as expected.
Perform a check-in and watch the tfs build create the compressed files for you.
For debugging the tfs build, you'll find the logs in the msbuild log which is linked inside the normal tfsbuild log.
I hope this helps someone out there. I couldn't find a decent guide anywhere so now there is one here! If you have other suggestions, feel free to add them or post them in the comments.
One thing that sticks out at me is that you're using $(TargetDir)..\ - which expands to \Binaries..\. I suspect that you don't have a Binaries.. directory, and that this is supposed to be \$(TargetDir)\..\. (Ie, the parent of the Binaries directory.)

How do you create a simple comment header template for all new classes in Visual C++ 2010?

This may be a duplicate, but I haven't found anything that answers it thus far. My company passed a resolution that all files need to have a boilerplate comment header, with file name and copyright date among other things. I was hoping there would be an easy way to just create a header template that is added to the top of every new class (.cpp and .h files) added to the project with a couple of variables that are replaced based on the date, file name, etc.
Unfortunately, it seems like this is a much larger task that it seems it should be. I've looked into Manipulating Code using the Visual C++ Code Model and Manually Creating an Item Template and can't seem to get any of them to do what I want.
Sorry if this sounds like a "do my work for me" post, but to me this just isn't worth spending that much time on. If it's going to take a day to figure out the subtleties of extending Visual Studio, I can just manually add and edit the header for each new file, as it isn't done that often. Is there an easier method than those I was looking at, or a simple example on how to utilize those methods for my purpose?
This may not get you any further than you have already got, but Simon is close in that you can create C++ file templates in the way that he suggests, but the path to the C++ templates is C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcprojectitems (note that on 32-bit machine it will just be Program Files).
If you edit the file NewC++File.cpp, the next time you add a new C++ file to a project your template will be used. Alternatively you can create your own files in this folder and they will appear in the Add New Item dialog.
This won't solve your problem around inserting the current date in the header (assuming you want that to be automatically determined), but you could update the template that you're using once a year, and that would be slightly less of a chore.
HTH
What you are looking for is called : Code Snippets
I personnaly use the snippets provided into VAssistX but it's a shareware so it's might not be a good solution for your company.
By the way if you are developing application on Visual C++ without VAssistX you are wasting a lot of time ;)
There is also a code snippets manager into Visual Studio, i never used it but i found some documentation on google :
http://msdn.microsoft.com/en-us/library/d60kx75h(VS.80).aspx
and
http://blogs.microsoft.co.il/blogs/gilf/archive/2009/01/17/how-to-write-your-own-code-snippets.aspx
I hope it's will be helpfull.
Update: Unfortunately, the C++ templates do not work in the same way.
I have left the text below as a reference to anyone who finds this, but it only works for C#/VB.
You can definitely edit the class template for C# (we have done it for exactly the same reason as you - to include a standard header), I would assume you can do it for C++ too.
Check out these two directories:
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\"
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\"
Somewhere in each of those directories will be a class template folder. For C# it's in a zip file here:
...\ItemTemplates\CSharp\Code\1033\Class.zip
Extract the zip, edit the template to include your header and re-zip it. You will also then need to place an unzipped copy under the ItemTemplatesCache folder, (following the same path - ...\ItemTemplatesCache\CSharp\Code\1033\Class)
There are more details here.
(Sorry, I'm on my Linux PC now so I can't check if these paths exist for C++. If you get it to work, post the correct C++ paths back here, and I'll update this answer to reference them)